问题标签 [offline-browsing]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
html - 如何关闭 HTML5 离线缓存
我在我的网站上使用 HTML5 离线缓存已经有一段时间了,出于某些原因,我正在考虑将其关闭。令我惊讶的是,它不起作用。
这就是我实现 HTML5 离线缓存的方式。
在我的index.html
我给出清单文件的路径
在 app.manifest 文件中,我列出了我希望浏览器缓存以供离线使用的所有 js/css/png 文件。每次部署更新时,我都会更新 app.manifest 文件,这会导致浏览器获取清单文件中列出的所有文件的最新版本。
为了关闭离线缓存,我将 index.html 的开始标记更改为
我对 app.manifest 文件进行了虚拟更改,以便浏览器(已经缓存了我的网站)将检测到更改并下载所有文件的最新版本(包括 index.html)。
我注意到的是,浏览器确实获得了所有文件的最新版本。我在没有清单声明的更新版本中看到了新<html>
标签,但是浏览器对未来更改的行为没有改变。即我现在希望浏览器在服务器上更改时立即获取新版本的 index.html 文件。然而,这不会发生。在我对清单文件进行任何更改之前,浏览器不会下载更新的 index.html。
<html>
因此,在我看来,浏览器已将 app.manifest 文件与我的网站 URL 永久关联,即使我没有在标签中提及它,它也不会删除它。
我已经在 Google Chrome 和 Firefox 上进行了测试,结果相同。我也尝试重新启动 Chrome,但它不会忘记我的网站曾经为它定义了 app.manifest。我还没有找到任何关于网络上离线缓存这方面的讨论。
更新:我设法通过清除所有浏览数据(通过转到设置)来摆脱 Chrome 中的行为。但这不是我可以告诉用户做的事情。
ruby-on-rails - 如何使用 ruby on rails 应用程序进行在线/离线同步?
有没有办法与 Rails 项目进行离线同步?
换句话说,我们的客户正在使用他们的网站来展示照片库,但他们需要能够在没有活跃的互联网连接的情况下做到这一点。在任何时候,他们都可以重新上线 - 并下载任何新数据 - 以便能够继续展示他们的画廊?
谢谢!
javascript - 如何从离线可用的网络应用程序访问在线资源?
我刚刚创建了一个带有缓存清单等的离线可用的网络应用程序。它工作得很好,但我想访问缓存清单中未提及的一些图片,当我在线时它们根本不会出现。
此外,当应用程序离线时,是否有任何简单的方法来加载默认图像?
提前致谢!
编辑:这些图片的路径是从单独的 Web 服务动态加载并保存在本地存储中。
重新编辑:
好的,我找到了解决方案:
只需将以下行添加到缓存清单中:
网络:
*
这将允许 Web 应用程序访问不在 CACHE: 清单文件部分中的每个元素。实际上,如果没有 NETWORK: 部分,则访问被阻止。
html - 离线应用的用户身份验证
我有使用 asp.net mvc 2 创建的简单 jQuery Mobile 站点,并使用基本表单身份验证来授予对站点的访问权限。
该应用程序是一个简单的工作日记,允许区域经理查看分配给区域团队的当前问题的详细信息。
当移动连接可用时,该应用程序运行良好,但由于缺乏信号,我们需要研究使应用程序核心离线可用的可能性。我一直在研究使用 html 5 使应用程序脱机的可能性,但找不到任何有关验证用户的信息。
该应用程序非常基础,基本上有两个不同的列表屏幕,可以深入了解工作细节。
我相信创建数据的离线版本会很容易,当连接不可用时允许浏览日记,但我找不到有关需要身份验证的站点的任何信息,然后才能访问允许的页面离线。
内容不是敏感数据,但显然客户不希望任何人能够在面向公众的网站上浏览工作日记。
对可能离线使用的站点中的用户进行身份验证的首选方法是什么?
html - HTML5 offline strange behaviour
I am having a problem with a web app that I'm working on and I have posted a question here which is a bit vague and probably not very helpful. I have decided to create a really basic site and build it up to be like the main app and see where it breaks. I have done this and got stuck straight away with the offline caching.
This is a basic 3 page static website hosted locally in IIS 7.5. I created the folder c:\inetpub\wwwroot\ManifestTesting, added it to IIS as a web application and added a new MIME type of text/cache-manifest for the .appcache extension. I am also using FireFox 9.0 for testing as this has an offline mode feature.
I created 3 html pages and added them to the ManifestTesting folder:
- index.htm - this page contains 2 links to page1.htm and page2.htm
- page1.htm - just contains a header that says page 1
- page2.htm - just contains a header that says page 2
So now if I browse to http://localhost/manifesttesting if get the index page and can navigate to the 2 pages.
I then created a file called manifest.appcache and added it to the ManifestTesting folder:
and added the reference to the manifest file in the index.htm:
So if I clear all history and browse to the index.htm, FireFox asks if I want to allow the website to store data for offline use. I click allow, switch the browser to offline mode then attempt to navigate to page1.htm which works fine! So all is good so far.
Now for the bit that I don't understand. I then created a new folder in the ManifestTesting folder called 'pages' and moved page1 and page2 into it. I updated the links in the index to reference the new location and if I browse the website without the manifest reference, it all works fine just as before. I then re-reference the manifest file in the index and update the manifest to be like:
I then clear history, refresh, firefox asks to allow the website to store offline data, enable offline mode and then attempt to navigate to page1 - it doesn't work! FireFox tells me it's in offline mode and can't browse the web!
What am I doing wrong?
html - HTML 5 离线存储缓存清单不适用于移动设备
我为移动设备创建了一个网络应用程序,我希望我也可以离线使用它。我使用清单文件,它可以在桌面浏览器上正常工作,但不能在移动浏览器上工作。问题是什么?提前致谢...
flash - 没有互联网运行的网站?
allaboutrajini 站点告诉您停止 Internet 连接以进入该站点。我想它决定了连接是使用 javascript 还是诸如 gmail 和 qoura 之类的东西打开或关闭。
但是他们怎么能在这么短的时间内在浏览器本地存储这么多的 Flash 动画内容呢?
javascript - Javascript离线读取文本文件
目前我使用此代码读取带有单词的txt文件并执行一些操作。但是,此特定代码需要将 html 部署在服务器上。是否有任何解决方法可以用其他代码替换此代码以读取文件而无需服务器?
html - HTML5离线数据存储
我使用 HTML5 离线存储
我的 Index.html 页面
离线缓存.manifest 文件
我的 htaccess
在第一次使用互联网加载页面然后禁用互联网并尝试访问此 index.html 后,缓存工作正常,但如果我再次点击 f5,图像不会显示(只有 alt 文本),当我点击url 栏并按回车键(好像是一个新请求)它工作正常......有什么方法可以维持页面刷新的缓存(f5)?
jquery - HTML 5 离线缓存后 jquery & dojo 不加载
我有该 html 网站的 html 网站头部分
宣言文件
我是否需要将每个 dojo 文件添加到 manifesto 或只是 index.html 将需要现在我在允许浏览器进行本地存储后得到错误是“dojo 未定义”和“$(document).ready”