html5 application cache遇到的比较严重难题_写一个小程序要多少钱_凡科小程序官网_微信小程序云开发_手机小程序制作_做一个小程序要多少钱

写一个小程序要多少钱_凡科小程序官网_微信小程序云开发_手机小程序制作_做一个小程序要多少钱移动版

建站首页 > 新闻 > 行业资讯 >

html5 application cache遇到的比较严重难题

在大家的3G版网站的新项目中应用了html5 application cache,将绝大多数照片資源、js、css等静态数据資源放在manifest文档中。

想不到上线第1天就遇到了比较严重难题:application cache会默认设置缓存文件当今网页页面!!!即使大家有以下设定:

拷贝编码
编码以下:

NETWORK:*

也便是说,针对全部的动态性网页页面,application cache会缓存文件起来,客户如何更新全是老的!

并且手机上访问器还很难消除掉,也不适用js消除!

花了1个上午,尝试了许多方法,查了许多材料,都没能消除掉顾客端缓存文件。1上午被客户投诉惨了。

最终還是全能的stackoverflow救了我:

Do not use appcache unless it is REALLY 100% EXACTLY WHAT YOU WANT TO DO
Even if it IS 100% EXACTLY WHAT YOU WANT TO DO, *DO NOT* use appcache until you are 100% CERTAIN 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 browser 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,另外能绕开全自动缓存文件当今网页页面的难题。那便是用iframe (责任编辑:admin)