1
<%
    response.setHeader("Cache-Control","no-cache"); 
    response.setHeader("Pragma","no-cache"); 
    response.setDateHeader ("Expires", -1); 
%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="com.services.*" import="java.util.*"
    import="java.text.*"%>
<jsp:include page="top.jsp"></jsp:include>

<html>
    <head>
        <link href="login-box.css" rel="stylesheet" type="text/css" />
    </head>
    <body onload="getcontacts();deleteContact();">    
</html>

我试图阻止我的 Web 应用程序缓存,我插入了以下代码:

<%
    response.setHeader("Cache-Control","no-cache"); 
    response.setHeader("Pragma","no-cache"); 
    response.setDateHeader("Expires", -1); 
%>

但它仍然在缓存,当我注销并按下它时,它仍然会回到上一个会话。任何 hlep plz。我应该插入其他东西吗?

4

0 回答 0