asp、html、js 禁止緩存的代碼
更新時(shí)間:2015年05月19日 11:51:38 投稿:hebedich
本文給大家分享的是在asp、html、js中強(qiáng)制不緩存的方法,十分的簡(jiǎn)單實(shí)用,有需要的小伙伴可以參考下。
ASP
Response.Buffer = True Response.ExpiresAbsolute = Now() - 1 Response.Expires = 0 Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "No-Cache"
HTML
<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
對(duì)于js,可以在引用js的時(shí)候 后面隨便加一個(gè) 隨機(jī)的參數(shù),隨機(jī)參數(shù)由當(dāng)前頁(yè)面的js生成,例如:
<script type="text/javascript" src='jscript.js?rnd=10092'>
以上所述就是本文的全部?jī)?nèi)容了,希望大家能夠喜歡。
相關(guān)文章
ADO存取數(shù)據(jù)庫(kù)時(shí)如何分頁(yè)顯示
這篇文章主要介紹了ADO存取數(shù)據(jù)庫(kù)時(shí)如何分頁(yè)顯示,需要的朋友可以參考下2015-10-10asp連接access、sql數(shù)據(jù)庫(kù)代碼及數(shù)據(jù)庫(kù)操作代碼
asp連接access、sql數(shù)據(jù)庫(kù)代碼及數(shù)據(jù)庫(kù)操作代碼,需要的朋友可以參考下2012-10-10