1.如某文件 index.html 连接到 permanote.appcache,即:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
manifest="{% static 'book20/manifest/permanote.appcache' %}">
在permanote.appcache中即使不出现index.html,也会自动缓存index.html。相反,如果加上index.html,在safari下会引起异常。
2.permanote.appcache中的每一文件的url按照 相对于permanote的url(不是物理路径)填写。
3.在httpd.conf或.htaccess中添加一行,以设置正确的文件头。
AddType text/cache-manifest .appcache
4.浏览器reload index.html时,会到服务器get permanote.appcache文件,如返回状态码为304,表示清单文件没有变动,浏览器随后只是从缓存中load相关资源。
如返回状态码为200,表示清单已更新(清单上的资源可能更新,也可能未),浏览器会异步地load缓存上的旧资源, get index.html和清单上的资源(不管新旧)到缓存。这时浏览器看到的还是旧内容,需再load一次才能看到变动。