How To Prevent IE Cache JSP Pages
时间:2006-06-09 来源:aurorean
1. Use methods provided by JAVA. In JSP or Servlet, you can add set the header attribute of response.
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0); 2. In your JSP or HTML files, add the below attributes in header part. <HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
</HEAD>
实际上,第二种方法有时并没有真正起作用。用第二种方法,在回退时,至少IE6.0并不是每次都会重新请求Server.
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0); 2. In your JSP or HTML files, add the below attributes in header part. <HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
</HEAD>
实际上,第二种方法有时并没有真正起作用。用第二种方法,在回退时,至少IE6.0并不是每次都会重新请求Server.
相关阅读 更多 +