我有一个 HTML 文档和一个关联的应用程序缓存 list 。但是现在我想暂时摆脱离线应用程序缓存。
如果我从 <html>
中删除对 list 的提及标记,已经具有缓存版本的浏览器将继续使用该缓存版本。
如果我更新 appcache list ,无论如何,仍然有一个 appcache。
删除离线应用程序缓存的最明智方法是什么?我想我可以将 list 更改为除以下内容外没有其他条目:
NETWORK:
*
然后它实际上不会缓存任何东西。
但肯定有办法完全摆脱应用缓存和 list 文件,不是吗?
最佳答案
您只需从您的服务器中删除应用缓存 list 。如果浏览器无法访问 list 文件,它将停止缓存您的应用并删除所有缓存数据。
来自两个站点的一些有用信息:
If the manifest file itself can't be retrieved, the cache will ignored and all cached data associated with it will be disregarded.
http://appcache.offline.technology/
Application caches can also become obsolete. If the manifest is removed from the server, the browser removes all application caches that use that manifest, then sends an "obsoleted" event to the application cache object. Then the application cache's status is set to OBSOLETE.
https://developer.mozilla.org/en/Offline_resources_in_Firefox
关于html - 删除 HTML5 离线 AppCache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7937736/