HTML 5 Appcache 适用于 safari/opera/chrome,但不适用于 Firefox

发布于 2024-12-05 02:29:26 字数 1966 浏览 1 评论 0原文

我有一个在网站上运行的 html5 appcache,它在 Safari、Opera 和 Chrome 中工作正常,但在 Firefox 上无法工作。

我的代码中有以下内容:

<!DOCTYPE HTML>
<html manifest="./manifest.appcache">
<head>

以及以下 manifest.appcache 文件:

CACHE MANIFEST
/
/accessibility
/anchoring
/areas-of-application-in-business
/calibrating-rep-system-preferences
/circle-of-excellence
/collapse-anchors
/contrastive-analysis-and-mapping-across
/convincers
/creating-an-air-of-authority
/decision-making
/elicitation-of-submodalities
/embedded-commands
/embedded-commands-2
/eye-patterns
/four-types-of-feedback
/home
/how-to-remember-names
/introduction-to-anchoring
/introduction-to-nlp
/key-elements-of-the-meta-model
/language-and-communication-model
/language-patterns
/leadership
/modelling
/my-action-plan
/new-behaviour-generator
/nlp-presuppositions
/outcome-thinking
/pacing-and-leading
/perceptual-positions
/predicate-phrases
/predicates
/preference-test
/presupposition-cards
/presuppositions
/privacy
/rapport
/rapport-pacing-and-leading
/representational-systems
/sensory-acuity
/strategies
/structure-for-adjusting-feedback
/structure-of-nlp-techniques
/structure-vs-content
/submodalities
/submodalities-and-strategies
/submodalities-checklist
/terms-and-conditions
/the-6-deadly-words
/the-meta-mirror
/the-power-of-presuppositions
/the-problem-frame-and-the-outcome-frame
/user-profile
/well-formed-outcomes
/what-is-nlp
/userImages/nlp_language_comm.png
/css/mobile.css
/css/style.css


# Hash: a4e8f4f6a4dd45dd3e8acdaae8546a0a

我正在使用此处的代码: http://jonathanstark.com/blog/2009/09/27/debugging-html-5-offline-application-cache/ 调试应用程序缓存并显示网站上的输出。

在 Firefox 中,调试代码的输出显示它下载了所有文件并调用交换缓存。如果我随后断开与互联网的连接并单击本应下载的另一个页面的链接,我会在 Firefox 中收到“无法连接”消息,而在 Safari、Opera 和 Chrome 中执行相同操作时,效果很好。

任何帮助和建议将不胜感激。

谢谢 史蒂夫

I have an html5 appcache running on a website, it works fine in Safari, Opera and Chrome but it fails to work on Firefox.

I have the following in my code:

<!DOCTYPE HTML>
<html manifest="./manifest.appcache">
<head>

and the following manifest.appcache file:

CACHE MANIFEST
/
/accessibility
/anchoring
/areas-of-application-in-business
/calibrating-rep-system-preferences
/circle-of-excellence
/collapse-anchors
/contrastive-analysis-and-mapping-across
/convincers
/creating-an-air-of-authority
/decision-making
/elicitation-of-submodalities
/embedded-commands
/embedded-commands-2
/eye-patterns
/four-types-of-feedback
/home
/how-to-remember-names
/introduction-to-anchoring
/introduction-to-nlp
/key-elements-of-the-meta-model
/language-and-communication-model
/language-patterns
/leadership
/modelling
/my-action-plan
/new-behaviour-generator
/nlp-presuppositions
/outcome-thinking
/pacing-and-leading
/perceptual-positions
/predicate-phrases
/predicates
/preference-test
/presupposition-cards
/presuppositions
/privacy
/rapport
/rapport-pacing-and-leading
/representational-systems
/sensory-acuity
/strategies
/structure-for-adjusting-feedback
/structure-of-nlp-techniques
/structure-vs-content
/submodalities
/submodalities-and-strategies
/submodalities-checklist
/terms-and-conditions
/the-6-deadly-words
/the-meta-mirror
/the-power-of-presuppositions
/the-problem-frame-and-the-outcome-frame
/user-profile
/well-formed-outcomes
/what-is-nlp
/userImages/nlp_language_comm.png
/css/mobile.css
/css/style.css


# Hash: a4e8f4f6a4dd45dd3e8acdaae8546a0a

I am using the code from here: http://jonathanstark.com/blog/2009/09/27/debugging-html-5-offline-application-cache/ to debug the appcache and display the output on the site.

In firefox the output from the debug code shows it downloading all the files and calling swap cache. If I then disconnect from the internet and click on a link to another page which should have downloaded I get the Unable to Connect message in Firefox, while doing the same in Safari, Opera and Chrome it works fine.

Any help and suggestions would be appreciated.

Thanks
Steve

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

☆獨立☆ 2024-12-12 02:29:26

查看服务器是否为生成的文件设置了 no-cache/no-store 标头。与其他浏览器相反,Firefox 将忽略该清单。

Look if the Server sets no-cache/no-store headers for the generated files. Firefox will then ignore the manifest in contrary to the other browsers.

吃素的狼 2024-12-12 02:29:26

我有类似的问题。问题是 FireFox 缓存文件更加积极,因此我必须添加这些标头:

对于清单:

Pragma: no-cache
Cache-Control: no-cache
Expires: date

对于文件:

Last-Modified: date
Cache-Control: no-cache
Expires: date

date 替换为 RFC 1123 格式的当前日期。

I had a similar problem. The problem was that FireFox cache file more aggressively, so I had to add these headers:

For the manifest:

Pragma: no-cache
Cache-Control: no-cache
Expires: date

And for the files:

Last-Modified: date
Cache-Control: no-cache
Expires: date

Replace date by the RFC 1123 formated current date.

岛歌少女 2024-12-12 02:29:26

检查是否设置了 no-cache/no-store 标头

check if the no-cache/no-store headers are set

2024-12-12 02:29:26

我有类似的问题。

  1. 确保清单文件的类型为“text/cache-manifest”,
  2. 请勿在 Firefox/IE 的隐私浏览模式下尝试。它仅适用于常规浏览模式。但它在 Chrome 中的两种模式下均有效
  3. 离线时,简单更改 URL 可能会出现问题

    • http://localhost:8080/app 不适用于 Firefox/IE
    • http://localhost:8080/app/ 适用于 Firefox/IE

    它们都可以在 Chrome 中工作

  4. 使用这些方便的资源查看器获得更详细的视角
    • 关于:缓存 - Firefox
    • chrome://appcache-internals/ - Chrome

如果有人知道 IE 是什么,请填写。

I had a similar problem.

  1. Make sure the manifest file is served as type "text/cache-manifest"
  2. Dont try it out in Private Browsing mode in Firefox/IE. It only works in regular browsing mode. But it works in both modes in Chrome
  3. While offline, a simple change in the URL could be a problem

    • http://localhost:8080/app doesn't work on Firefox/IE
    • http://localhost:8080/app/ works on Firefox/IE

    Both of them work in Chrome

  4. Use these handy resource viewers to get more detailed perspective
    • about:cache - Firefox
    • chrome://appcache-internals/ - Chrome

Please fill in if someone knows what is it for IE.

墨落成白 2024-12-12 02:29:26

在 Firefox 偏好设置 ->高级->网络,在“以下网站已存储数据供离线使用:”列表中,您看到您的网站吗?如果是这样,请尝试从列表中清除您的网站,然后重新加载您的网站。

In Firefox Preferences -> Advanced -> Network, in the "The following websites have stored data for offline use:" list, do you see your website? If so, try clearing your website from the list and then reloading your website.

寂寞笑我太脆弱 2024-12-12 02:29:26

Earl 的上述回答与关闭 FireBug 结合起来对我有用。

在 Firefox 首选项中 ->高级->网络,在“以下
网站已存储数据供离线使用:“列表,您看到您的
网站?如果是这样,请尝试从列表中清除您的网站,然后
正在重新加载您的网站。

Earl's answer above worked for me in combination with turning FireBug off.

In Firefox Preferences -> Advanced -> Network, in the "The following
websites have stored data for offline use:" list, do you see your
website? If so, try clearing your website from the list and then
reloading your website.

仅冇旳回忆 2024-12-12 02:29:26

我也面临同样的问题;这个标题对我来说是修复的。

内容类型:文本/缓存清单

I face the same problem too; this header is fix for me.

Content-Type: text/cache-manifest

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文