1) 在HTML頁面裡加入..
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
</HEAD>
2) 在JSP程式頁首加入
// 網頁暫存取消
if (request.getProtocol().compareTo("HTTP/1.0") == 0 )
response.setHeader("Pragma", "no-cache");
else if (request.getProtocol().compareTo("HTTP/1.1") == 0 )
response.setHeader("Cache-Control", "no-cache");
//prevents caching at the proxy server
response.setDateHeader("Expires", 0);
//HTTP 1.1
response.setHeader("Cache-Control","no-store");
3) 在ASP程式裡頁首處加入..
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "No-Cache"
沒有留言:
發佈留言