html5怎么弄一个希望清单,html5 – 一旦HTML文档有一个清单(cache.manifest),你如何删除它?...

我一直在研究同样的问题,它似乎不是一个api:

>动态触发页面被缓存

>动态地使页面停止被缓存。

以下是我找到的最好的资源:

特别是从第一个链接引用:

If the manifest file or a resource specified in it fails to download,the entire update fails. The browser will continue to use the old application cache in the event of such a failure.

否则,关于卸载高速缓存的任何地方都没有提及。

似乎建议你不要强制一个错误来取消它。但是,如下所述,该规范表明,如果在下载清单文件时发生错误,则整个缓存将被删除。

在google chrome中,用户可以转到以下URL:

并手动禁用缓存。当然,当他们下次访问该页面时,如果该页面具有清单属性设置,那么它将被重新刷新。

似乎建议缓存被删除的情况。具体来说,第5.6.4.5节:

If fetching the manifest fails due to a 404 or 410 response or equivalent,then run these substeps:

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.

If cache group has an application cache whose completeness flag is incomplete,then discard that application cache.

然后说:

If this was a cache attempt,discard cache group altogether.

基本上,如果缓存清单文件的请求导致404,那么整个缓存应该被丢弃。那么,当缓存清单文件被请求时,是否尝试使服务器返回404或410?这应该工作。诀窍是只返回要删除清单的页面的404/410(可能使用url参数?)。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值