禁止页面缓存的方法

1, 在jsp或者servlet中加入
<%
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
%>
2, 在页面中使用HTML标记,如下面:
<HEAD>
<META http-equiv=Pragma content=no-cache>
<META http-equiv=Cache-Control content=no-cache>
<META http-equiv=Expires content=0>
3,<%@ OutputCache duration="1"  Location="none"   %><%@ OutputCache duration="1"  Location="none"   %><%@ OutputCache duration="1"  Location="none"   %>
<%@ OutputCache duration="1"  Location="none"   %>
posted @ 2006-07-09 13:53  泡面 @ 幸福  阅读(219)  评论(0)    收藏  举报