如何防止浏览器的缓存JSP页面

来源:互联网 发布:魔兽正义长袍数据库 编辑:程序博客网 时间:2024/05/17 01:56

把下列语句加入到你的jsp文件中的<head></head>部分,以防止浏览器将你的页面放入缓存之中:
<%
response.setHeader("Pragma","no-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
%>

<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
 

原创粉丝点击