JS 如何清除页面缓存
2015-03-19 18:19
295 查看
缓存有利于加快页面的加载速度,是实现高效web的一种方法,但是,有时,我们需要让页面不缓存,例如,升级,这样我们需要在页面中或者服务器做一些处理。
1.动态页面:index.asp?id=....
2.使用jquery,$.ajaxSetup({cache : false });
3.在html里的head标签中加
<meta http-equiv ="proma" content = "no-cache"/>
<meta http-equiv="cache-control" content="no cache" />
<meta http-equiv="expires" content="0" />
另外一种:
<html http-equiv="proma" content="no-cache"/>
<html http-equiv="content-type" content="no-cache , must-revalidate"/>
<http http-equiv="expires" content=" Wed , 26 Feb 1997 08:21:57 GMT"/>
另外 ,在提交信息时,总是出现旧的内容,此时就应该考虑是本地浏览器缓存的原因了。
清空临时缓存的方法:
<body onload ="javascript : document.yourFormName.reset()">
1.动态页面:index.asp?id=....
2.使用jquery,$.ajaxSetup({cache : false });
3.在html里的head标签中加
<meta http-equiv ="proma" content = "no-cache"/>
<meta http-equiv="cache-control" content="no cache" />
<meta http-equiv="expires" content="0" />
另外一种:
<html http-equiv="proma" content="no-cache"/>
<html http-equiv="content-type" content="no-cache , must-revalidate"/>
<http http-equiv="expires" content=" Wed , 26 Feb 1997 08:21:57 GMT"/>
另外 ,在提交信息时,总是出现旧的内容,此时就应该考虑是本地浏览器缓存的原因了。
清空临时缓存的方法:
<body onload ="javascript : document.yourFormName.reset()">
相关文章推荐
- 如何解决HTML5页面js,css缓存问题
- 如何清除页面的图片缓存
- 页面清除js缓存
- 如何清除客户端的页面缓存文件???用JSP怎么实现???
- oscache如何缓存页面及如何强制清除指定页面的缓存
- 刷新页面,重新加载js,清除缓存拒绝304
- asp.net如何清除页面缓存?
- 关于pjax 如何设置不缓存加载页面里面的js文件和不修改浏览器中的URL地址
- Chrome浏览器清除页面js文件缓存的方法
- 如何清除jsp页面缓存、cookie、session?
- 如何解决网站页面CSS、JS脚本在浏览器的缓存问题
- 如何清除jsp页面缓存、cookie、session
- 用 Servlet Filter 缓存页面图片、js教本等静态文件
- 用编程来实现清除aspx页面缓存
- 如何防止浏览器的缓存JSP页面
- JS如何设置打开页面后将光标定位在指定的输入框?
- 如何清除应用程序承载 WebBrowser 控件时缓存
- jsp,html 清除页面缓存
- 清除页面缓存
- [Web2.0]html页面如何通过js加载后台信息