HTML5 application Cache Firefox 正在缓存未列出的当前页面
HTML5 application Cache Firefox is caching the not listed current page
我的清单如下所示:
<?php
header("Cache-Control: no-cache, private");
header("Content-Type: text/cache-manifest");
?>
CACHE MANIFEST
# v32
/wp-content/plugins/sitepress-multilingual-cms/res/css/language-selector.css?v=3.1.9.3
/wp-content/themes/mytheme/css/reset.css
/wp-content/themes/mytheme/js/jquery-2.1.3.min.js
/wp-content/themes/mytheme/img/reset.png
/wp-content/themes/mytheme/img/tablette_petit.png
/wp-content/themes/mytheme/img/ordi_petit.png
/wp-content/themes/mytheme/img/home.png
/wp-content/themes/mytheme/img/update.png
/wp-content/themes/mytheme/font/tahoma2.ttf
FALLBACK:
/ /offline/
目标是在任何页面离线时显示离线页面。
此清单是在访问页面时设置的:
<!doctype html>
<?php
$manifest="";
if($pagename == "mypage"){
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false){
$manifest="manifest=\"/cachemanifest/\"";
}else{
$manifest="manifest=\"/cachemanifestothers/\"";
}
}
//$manifest="";
?>
<html class="mainsite" <?php echo $manifest; ?>>
(chrome 有一个特殊的清单,因为缓存运行良好)
问题是 firefox 正在缓存我的页面:
当我修改它时,F5 什么都不做,直到我更新清单。
在 about:cache 中,我看到列出的每个文件 + /mypage。
但是此页面未在 CACHE: 部分中列出。
每次修改这个页面都要更新manifest,很无聊...
稍后当我离线访问 /mypage 时,我不会退回到 /offline 页面,而是看到 /mypage 因为它被缓存并且页面被破坏,因为它错过了很多 js / css 。
感谢帮助
好吧,这不是错误,它是应用程序的一个功能,它被称为主条目。
https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache#Master_entries
在这里讨论:
http://www.webdirections.org/blog/appcache-not-so-much-a-douchebag-as-a-complete-pain-in-the/
A master entry is an HTML file that includes a manifest attribute in
the html element that points to a manifest file (which is the only way
to create an HTML5 appcache BTW). Any such HTML file is automatically
added to the cache.
我的清单如下所示:
<?php
header("Cache-Control: no-cache, private");
header("Content-Type: text/cache-manifest");
?>
CACHE MANIFEST
# v32
/wp-content/plugins/sitepress-multilingual-cms/res/css/language-selector.css?v=3.1.9.3
/wp-content/themes/mytheme/css/reset.css
/wp-content/themes/mytheme/js/jquery-2.1.3.min.js
/wp-content/themes/mytheme/img/reset.png
/wp-content/themes/mytheme/img/tablette_petit.png
/wp-content/themes/mytheme/img/ordi_petit.png
/wp-content/themes/mytheme/img/home.png
/wp-content/themes/mytheme/img/update.png
/wp-content/themes/mytheme/font/tahoma2.ttf
FALLBACK:
/ /offline/
目标是在任何页面离线时显示离线页面。
此清单是在访问页面时设置的:
<!doctype html>
<?php
$manifest="";
if($pagename == "mypage"){
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false){
$manifest="manifest=\"/cachemanifest/\"";
}else{
$manifest="manifest=\"/cachemanifestothers/\"";
}
}
//$manifest="";
?>
<html class="mainsite" <?php echo $manifest; ?>>
(chrome 有一个特殊的清单,因为缓存运行良好)
问题是 firefox 正在缓存我的页面: 当我修改它时,F5 什么都不做,直到我更新清单。 在 about:cache 中,我看到列出的每个文件 + /mypage。 但是此页面未在 CACHE: 部分中列出。
每次修改这个页面都要更新manifest,很无聊... 稍后当我离线访问 /mypage 时,我不会退回到 /offline 页面,而是看到 /mypage 因为它被缓存并且页面被破坏,因为它错过了很多 js / css 。
感谢帮助
好吧,这不是错误,它是应用程序的一个功能,它被称为主条目。
https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache#Master_entries
在这里讨论:
http://www.webdirections.org/blog/appcache-not-so-much-a-douchebag-as-a-complete-pain-in-the/
A master entry is an HTML file that includes a manifest attribute in the html element that points to a manifest file (which is the only way to create an HTML5 appcache BTW). Any such HTML file is automatically added to the cache.