来源:
本站
类别:
软件教程
日期:
2016/3/1
本文给大家分享的是在asp、html、js中强制不缓存的方法,十分的简单实用,有需要的小伙伴可以参考下。
?
1
2
3
4
5 |
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma" , "No-Cache"
|
HTML
?
1
2
3
4 |
< meta http-equiv = "Content-Type" content = "text/html; charset=gb2312" />
< meta http-equiv = "Pragma" CONTENT = "no-cache" >
< meta http-equiv = "Cache-Control" CONTENT = "no-cache" >
< meta http-equiv = "Expires" CONTENT = "0" >
|
Javascript
对于js,可以在引用js的时候 后面随便加一个 随机的参数,随机参数由当前页面的js生成,例如:
?
1 |
<script type= "text/javascript" src= 'jscript.js?rnd=10092' >
|
以上所述就是本文的全部内容了,希望大家能够喜欢。