为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

HTML5 Cache Manifest set to always go to network, Firefox says "This web site is asking to store data on your computer for offline use."

  • 4 个回答
  • 9 人有此问题
  • 4 次查看
  • 最后回复者为 stvgld

more options

I have a simple HTML5 website and when I update it often I cannot see the changes because Firefox reads the old page from cache. So I put in a Cache Manifest file to indicate that nothing should be cached as follows:

CACHE MANIFEST NETWORK

Even though we are caching nothing, Firefox puts up a confusing warning to the user:

"This web site is asking to store data on your computer for offline use." with three buttons.

How can my website instruct Firefox that nothing is being cached and to suppress the (inaccurate) warning?

I have a simple HTML5 website and when I update it often I cannot see the changes because Firefox reads the old page from cache. So I put in a Cache Manifest file to indicate that nothing should be cached as follows: CACHE MANIFEST NETWORK * Even though we are caching nothing, Firefox puts up a confusing warning to the user: "This web site is asking to store data on your computer for offline use." with three buttons. How can my website instruct Firefox that nothing is being cached and to suppress the (inaccurate) warning?

所有回复 (4)

more options

A cache manifest for storing data offline doesn't have anything to do with seeing an older version of web pages.

The offline cache is used by specific applications so they can store specific data on your computer.

You would have the server send HTTP response headers to disable caching in Firefox like .

You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files in such cases.

  • Press and hold Shift and left-click the Reload button.
  • Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
  • Press "Command + Shift + R" (MAC)
more options

Thank you for your quick response; I am somewhat confused by your answer:

1. I have examples from W3School and others that show, in HTML5, if you want to insure that the web page refreshes from the server then you use the construct "NETWORK <newline>*", as the only command after "CACHE MANIFEST". It is further detailed in http://www.w3schools.com/html/html5_app_cache.asp.

2. How do you recommend that the web site insures the user always gets a fresh reload when content has changed on a web page?

3. Why would Firefox alert the user that offline caching is requested when the manifest file explicitly instructs the browser NOT to cache (always go to the network)? Note that no other browser does this. Firefox seems to just throw up the warning whenever a reference to a manifest file is seen, without examining whether there is actually caching requested! Very confusing to the ultimate user.

Your help is very much appreciated.

more options

Quote: HTML5 introduces application cache, which means that a web application is cached, and accessible without an internet connection.

This only applies to special web applications that store data locally and not to the way web pages are rendered.
If you only have a problem with Firefox not showing the current version of (your) web page after having updated the code then this is about data store in the disk cache and not the offline storage.
You can normally see the caches mentioned on the about:cache page.
The disk cache can be missing in Private Browsing mode and if you clear the cache when you close Firefox.

由cor-el于修改

more options

Thank you, that does clarify the usage of the Cache Manifest file. I'll continue to look into the data cache issue to resolve my problem, which is that when I update the html code the resulting changes do not always show on the page (and also not in the page source).

If anyone knows how, in HTML5, to assure that changes in the page coding will be loaded by the user's browser when he has the old version cached that would be very helpful!

(In other words, <meta http-equiv="Cache-Control" content="no-cache"/>, which is no longer valid in HTML5.)

由stvgld于修改