如何防止IE缓存jsp文件
程序员文章站
2023-12-18 10:50:58
1, 使用java提供的方法,在jsp或者servlet中都可以 <% response.setheader("pragma","no-...
1, 使用java提供的方法,在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">
</head>
<%
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">
</head>