HTML5 应用程序缓存白名单问题 - 不会忽略项目
我正在尝试使用 HTML5 应用程序缓存来加快 iPhone Web 应用程序上的某些操作。它非常适合存储图像、CSS 和 JS,但问题是它还尝试存储 HTML。我无法让它忽略 html 并停止将其存储在缓存中。根据我的阅读,我必须将我想要加载的文件和目录“列入白名单”。我尝试列出我想要显式缓存的文件,并尝试在“网络:”标题下添加一系列内容。我已经尝试过,
*
/
/*
http://mysite.com
http://mysite.com/
http://mysite.com/*
但似乎都不起作用。有没有办法通过 MIME 类型或其他方式忽略 HTML 文件?任何建议将不胜感激。
瑞安
P.S.当然,我的网站不是 mysite.com..我只是为了简单起见才使用它。
I'm trying to use HTML5 Application Cache to speed some things up on an iPhone webapp. It works great for storing images, css and JS, but the problem is that it also tries to store the HTML. I haven't been able to get it to ignore the html and stop storing it in the cache. From what I've read, I have to "whitelist" the files and directories that I want to load no matter what. I've tried listing the files I want cached explicitly, and I've tried adding a series of things under the "NETWORK:" heading. I've tried
*
/
/*
http://mysite.com
http://mysite.com/
http://mysite.com/*
None of them seem to work. Is there any way to ignore HTML files by MIME-Type or anything? Any advice would be appreciated.
Ryan
P.S. Of course, my site is not mysite.com..I just used that for simplicity.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过不在每个页面中引用清单来避免这个问题,而是在每个页面中都有以下内容:
在cache.htm 中我有:
I've avoided this problem by NOT referencing a manifest in each page, instead I have the following within each page :
inside cache.htm I have :
基于之前的测试 以及与 html5“生态系统”中的人们的讨论,每个指定清单的 html 页面也会自动缓存。
based on previous tests and discussions with people in the html5 "ecosystem", each html-page that specifies a manifest is automatically cached as well.