HTML5缓存不显示html文件本身的缓存 [英] HTML5 cache manifest no cache for html file itself

查看:147
本文介绍了HTML5缓存不显示html文件本身的缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

index.php:

index.php:

<html manifest="/cache.manifest">

cache.manifest

cache.manifest

CACHE MANIFEST

CACHE MANIFEST

CACHE:

/img.png
FALLBACK:
/ /offline.html
NETWORK:
*

一切都很好,除了索引.php文件本身被提取到缓存(在chrome中测试)。我可以禁用指定清单的文件的缓存,以便只缓存img.png吗?

Everything works great, except that the index.php file itself is fetched to cache (tested in chrome). Can I disable caching for the file specifying the manifest so that only the img.png is cached?

谢谢

推荐答案

不,引用清单的文件总是被缓存。来自规范

No, the file which references the manifest is always itself cached. From the spec:


声明清单(带有manifest属性)的资源将始终从缓存中获取,无论它是否在缓存中列出或不,即使它列在在线白名单命名空间中。

The resource that declares the manifest (with the manifest attribute) will always get taken from the cache, whether it is listed in the cache or not, even if it is listed in an online whitelist namespace.

这篇关于HTML5缓存不显示html文件本身的缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆