为什么Firefox检查应用程序缓存清单是否有更新?

Udo*_*o G 5 firefox html5 caching application-cache

我的应用程序缓存有问题,似乎只与Android桌面和Firefox上的Firefox有关.

这是我的清单文件,名为cache.manifest.php(PHP用于设置正确的HTTP标头):

CACHE MANIFEST
CACHE:
images/user.png
images/password.png
lang/de.js?contenthash=e4943126757ac9785cb499482625e0fc
lang/it.js?contenthash=e7c3f04d103d19685436836d445c2a66
images/vismode.png
images/box_tall.png
images/box_tall-red.png
images/box_tall-yellow.png
images/exit.png
fonts/Lato-300.woff
main.css?hash=content-hash-0aba852b903deacca756946164306753
3rdparty.js?hash=content-hash-a4954a81d109d892861216a3c20db476
core.js?hash=content-hash-8330a5d0f688d1f5f31a606d4def86ba
commonui.js?hash=content-hash-09e98ff1134c9f6030766b6216b1885a
zipperlebh.js?hash=content-hash-43070707ebbd8d5206cf3bb555e8430f
NETWORK:
/ajax.php
/error_notify_handler.php
/getfile.php
/getmedia.php
/http-proxy.php
/remotedesktop.php
# complete install hash: 5674308eabef29c807d72f536813e343
# index.php hash: cbee5e08081f0d0cbe70102922ead187
Run Code Online (Sandbox Code Playgroud)

它与这些HTTP响应标头一起提供:

Cache-Control: max-age=1, must-revalidate
Connection: keep-alive
Content-Length: 967
Content-Type: text/cache-manifest
Etag: 65b6119134c5c0e0ba80b9d5635184a5
x-powered-by: PHP/5.4.10
Run Code Online (Sandbox Code Playgroud)

通过桌面上的Android浏览器或Chrome浏览器,我得到了预期的行为:应用程序脱机工作,并在清单更改时更新.到现在为止还挺好.

但是,使用Firefox我得到奇怪的结果:

  • Windows上的Firefox(版本28到30)永远缓存应用程序,从不检查清单.浏览器和服务器都没有显示加载清单以检查更新的尝试.但是,应用程序在脱机模式下按预期工作.
  • Firefox版本27运行良好,AFAIK
  • 即使直接通过在地址栏中输入清单URL 来访问清单URL 也不会导致任何 HTTP请求 - 从缓存中读取URL.
  • 当直接访问清单URL时,但添加了查询字符串会导致理论上正确的行为:浏览器会检查服务器文件是否发生了更改(例如,获取HTTP 304).可能这种不正常的行为与这样一个事实有关,即这个修改过的URL不再是缓存应用程序的一部分.
  • 我试图Cache-Control: no-store在清单中添加一个标题,并尝试将清单URL添加到清单的NETWORK部分,没有任何运气.
  • AndroidFirefox 恰恰相反:它显然从不缓存应用程序.离线时,无法显示页面.

我发现了很多 提示,关于这个问题,但仍无法找到解决这个问题.