pragma 沒(méi)那么徹底,瀏覽器退后時(shí)候只是重新刷新內(nèi)容而已
代碼實(shí)例:
禁用客戶端緩存
HTM網(wǎng)頁(yè)
ASP網(wǎng)頁(yè)
<%
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
%>
PHP網(wǎng)頁(yè)
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
JSP
response.setHeader("Pragma","No-Cache");
response.setHeader("Cache-Control","No-Cache");
response.setDateHeader("Expires", 0);
C#中禁止cache的方法!
Response.Buffer=true;
Response.ExpiresAbsolute=System.DateTime.Now.AddSeconds(-1);
Response.Expires=0;
Response.CacheControl="no-cache";
加入
不緩存。