HTML5离线Appcache更新不显示在Firefox中 [英] HTML5 Offline Appcache Updates Not Showing In Firefox

查看:176
本文介绍了HTML5离线Appcache更新不显示在Firefox中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的文件根目录中有一个index.php文件。它产生以此开始的输出:

 <!DOCTYPE html> 
< html manifest =manifest.appcache>

manifest.appcache指示浏览器将其缓存以供离线使用。再次,相关部分:

  CACHE MANIFEST 

#version 8-25-2011

CACHE:

#内部HTML文档
#this告诉浏览器缓存从http://example.com/
/ $ b检索到的HTML
$ b网络:
*

离线访问工作正常,但是更新并不像我期望的那样在Firefox中运行。



在Chrome和Safari中,当我更新index.php文件,然后更改缓存中的注释时。清单文件,浏览器将获取新的index.php输出并将其用于缓存中。然而,在Firefox中,似乎并不在乎我已经更新了manifest.appcache文件。我怀疑如果我等待足够长的时间,它会更新,但我试过等待几个小时。



如何找到并消除我的缓存问题?

解决方案

您使用index.php文件发送了哪些HTTP缓存头文件?如果你没有设置 Cache-control: Expires:标题,那么Firefox可能会刷新应用程序缓存版本从常规缓存,而不是从服务器再次请求它。



问题的海报编辑

>

对于任何想要知道究竟花了多少钱的人,这里是基于这个答案放入我的.htaccess文件,并仔细阅读 http://www.diveintohtml5.info/offline.html

 < Files * .appcache> 
ExpiresActive在
ExpiresDefault访问
< / Files>

希望能帮助下一个人!


I have an index.php file in my docroot. It produces output that starts with this:

<!DOCTYPE html> 
<html manifest="manifest.appcache">

The manifest.appcache tells browsers to cache it for offline use. Again, the relevant parts:

CACHE MANIFEST

#version 8-25-2011

CACHE:

#internal HTML documents
#this tells the browser to cache the HTML it retrieves from http://example.com/
/

NETWORK:
*

Offline access is working fine with this setup, but updating is not working as I would expect in Firefox.

In Chrome and Safari, when I update the index.php file and then change a comment in the cache.manifest file, the browsers will grab the new index.php output and use that in the cache.

However, in Firefox, it seems to not care that I've updated the manifest.appcache file. I suspect that if I wait long enough, it will update, but I've tried waiting hours.

How can I find and eliminate my caching problem?

解决方案

What HTTP cache headers are you sending with your index.php file? If you've not set things like the Cache-control: and Expires: headers then Firefox could be refreshing the application cache version of the page from it's regular cache instead of requesting it again from the server.

EDIT BY POSTER OF THE QUESTION:

For anyone that wants to know what exactly it took, here's what I put in my .htaccess file based on this answer and a perusal of http://www.diveintohtml5.info/offline.html:

<Files *.appcache>
    ExpiresActive On
    ExpiresDefault "access"
</Files>

Hope that helps the next person!

这篇关于HTML5离线Appcache更新不显示在Firefox中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆