好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

html5 application cache遇到的严重问题

在我们的3G版网站的项目中使用了ht ML 5 application cache,将大部分图片资 源 、js、css等静态资源放在manifest文件中。

没想到上线第一天就遇到了严重问题:application cache会默认缓存当前页面!!!就算我们有如下设置:

复制代码

代码如下:


NETWORK:*


也就是说,对于所有的 动态页面 ,application cache会缓存起来,用户怎么刷新都是老的!

而且手机浏览器还很难清除掉,也不支持js清除!

花了一个上午,尝试了很多办法,查了很多资料,都没能清除掉客户端的缓存。一上午被用户投诉惨了。

最后还是万能的stackoverflow救了我:

Do not use appcache unless IT is REALLY 100% EXACTLY W hat YOU WANT TO DO
Even if it IS 100% EXACTLY WHAT YOU WANT TO DO, *DO NOT* use appcache until you are 100% CERT ai N that you are not going to make a single change to that page (or any file that it links to) for a LONG time.
Delete the manifest file From the server -- if the br owser can't find the manifest file, then it will clear its cache .. . ...this will also turn caching off for everyone.
Don't turn it on again until it's 100% CORRECT
Dealing with appcache is miserable, often.
解决办法很 简单 ,在 服务器 端删除掉manifest文件,并且 慎用 application cache

当然,也有办法是用application cache,同时能绕过自动缓存当前页面的问题。那就是用ifr am e

总结

以上是 为你收集整理的 html5 application cache遇到的严重问题 全部内容,希望文章能够帮你解决 html5 application cache遇到的严重问题 所遇到的问题。

如果觉得 网站内容还不错, 推荐好友。

查看更多关于html5 application cache遇到的严重问题的详细内容...

  阅读:25次