ASP 禁止页面被缓存

1、在Asp页面首部加入
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "No-Cache"

2、在HtML代码中加入
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
</HEAD>

3、在重新调用原页面的时候在给页面传一个参数
Href="****.asp?random()"


我的方法同第一种类似,是将下面语句写进一个asp头文件,然后其他每个页面一开始就include那个asp头文件。

''禁用页面缓存
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"

posted @ 2008-10-09 12:36  itecho  阅读(283)  评论(0编辑  收藏  举报