使用清单关闭应用程序缓存

编程入门 行业动态 更新时间:2024-10-20 07:43:25
本文介绍了使用清单关闭应用程序缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在编写一个HTML5应用程序,它使用Application Cache with manifest。

然而,当我正在开发时,我想关闭它。

我尝试从标签中删除清单属性,并将所有内容都切换到清单文件中的网络。

更新第一次更新时,所有子序列更新仍然从缓存中读取,而不是从服务器读取。

我可以看到HTML文件已经更新,并且不再有清单属性,但它仍然从缓存中加载。

在设置它后,我似乎无法弄清楚如何关闭它,所以这里是我的问题:

有没有办法在Google Chrome中关闭带有清单的应用程序缓存?

解决方案

在Chrome浏览器中,转到发动机罩 - >内容设置 - > Cookies - >显示Cookie和其他网站数据,应用缓存应显示在网站数据下。

b $ b

在Firefox中进入高级 - >网络,包含应用程序缓存的网站列在底部的框中​​。

没有办法目前完全从服务器端彻底删除或终止应用程序缓存。最好的办法是明确告诉浏览器删除所有缓存的文件 - 只有网络部分的清单应删除所有其他文件,但带有清单引用的文件本身始终会被缓存。

- 编辑

这个答案不再完全正确。目前,标准状态 $ b

如果由于404或410响应或等效而获取清单失败...标记缓存组已过时。此缓存组不能再存在,除了处理已与缓存组中的应用缓存相关联的Document对象以外的任何其他用途。

即:删除清单文件应该会在下次浏览器尝试更新时删除appcache

I'm writing a HTML5 application that uses "Application Cache with manifest".

However, while I'm developing I want to turn it off.

I tried removing the manifest attribute from the tag and switching everything to network in the manifest file.

Although it did update on the first update, all subsequence updates are still read from the cache rather than the server.

I can see that the HTML file has updated and there is no longer a manifest attribute on the tag, yet it still loads from the cache.

I can't seem to figure out how to turn it off once you've set it, so here's my question:

Is there a way to turn off "Application Cache with manifest" in Google Chrome?

解决方案

In Chrome, go to Under the bonnet -> Content Settings -> Cookies -> Show cookies and other site data, application caches should show up under the site data.

In Firefox go to Advanced -> Network, sites with application caches are listed in a box at the bottom.

There's no way completely to completely remove or expire an application cache from the server side at present. The best you can do is explicitly tell the browser to remove all the cached files - a manifest with just a network section should delete all the other files, but the file with the manifest reference will itself always be cached.

--edit

This answer is no longer entirely correct. Currently the standard states:

If fetching the manifest fails due to a 404 or 410 response or equivalent...Mark cache group as obsolete. This cache group no longer exists for any purpose other than the processing of Document objects already associated with an application cache in the cache group.

That is: deleting the manifest file should cause the appcache to be deleted the next time the browser attempts to update

更多推荐

使用清单关闭应用程序缓存

本文发布于:2023-11-01 01:36:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547868.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:缓存   应用程序   清单

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!