我们在 single-page-web-application
中使用 HTML5 应用程序缓存。 list 文件在 index.htm-file
的 -tag 中定义:
<html xxxxxxxxxxxxxxxxxxxxxxxxxxxxx manifest="/xxxxxx/xxxxx.appcache">
index.htm-file
是唯一从网络服务器加载的 htm-file
,因为网络应用程序是单页网络应用程序构建的angularJS。以下所有响应均采用 JSON
格式。
现在我们希望 index.htm-file
不缓存在 HTML5 应用程序缓存中。但是因为 list 文件是在 index.htm-file
中定义的,所以后面的文件也被隐式缓存。
有谁知道虽然 list 在 index.htm-file
中定义,但 index.htm-file
不被缓存是如何做到的?
最佳答案
我们遇到了 http://dukecon.org 的缓存问题.请查看此处的讨论:how to selectively disable cache for spring boot (manifest.appcache) .
也许我们解决方案的第二部分也能解决您的问题:为 index.html
文件设置无缓存 header ?这是通过 ServletFilter
执行的:https://github.com/dukecon/dukecon_server/blob/master/impl/src/main/java/org/dukecon/server/impl/CacheManifestFilter.groovy
喂!
关于HTML5 应用缓存 : How to exclude the htm-file from cache where the manifest is defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33218475/