This article will share with you the method of forcing no cache in asp, html, and js. It is very simple and practical. Friends in need can refer to it.
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
For js, you can add a random parameter after referring to js. The random parameters are generated by the js on the current page, for example:
- <scripttype=text/javascriptsrc='jscript.js?rnd=10092'>
The above is the entire content of this article, I hope you like it.