JS 如何清除页面缓存

来源:互联网 发布:网络销售是做什么 编辑:程序博客网 时间:2024/05/21 22:18

  缓存有利于加快页面的加载速度,是实现高效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()">

0 0
原创粉丝点击