本文給大家分享的是在asp、html、js中強制不緩存的方法,十分的簡單實用,有需要的小伙伴可以參考下。
ASP
- Response.Buffer=True
- Response.ExpiresAbsolute=Now()-1
- Response.Expires=0
- Response.CacheControl=no-cache
- Response.AddHeaderPragma,No-Cache
HTML
- <metahttp-equiv=Content-Typecontent=text/html;charset=gb2312/>
- <metahttp-equiv=PragmaCONTENT=no-cache>
- <metahttp-equiv=Cache-ControlCONTENT=no-cache>
- <metahttp-equiv=ExpiresCONTENT=0>
Javascript
對於js,可以在引用js的時候後面隨便加一個隨機的參數,隨機參數由當前頁面的js生成,例如:
- <scripttype=text/javascriptsrc='jscript.js?rnd=10092'>
以上所述就是本文的全部內容了,希望大家能夠喜歡。