JSP禁止缓存代码

 //JSP禁止缓存代码 response.setHeader("Pragma","No-cache"); response.setHeader("Cache-Control","no-cache"); response.setDateHeader("Expires", 0); //网络上的不能正确运行代码参考 if(request.getProtocol().compareTo("HTTP/1.0")==0) { request.setHeader("Pragma","no-cache"); } else { if(request.getProtocol().compareTo("HTTP/1.1")==0) request.setHeader("Cache-Control","no-cache"); } response.setDateHeader("Expires",0); 'ASP禁止缓存代码 Response.Buffer = True Response.ExpiresAbsolute = Now() - 1 Response.Expires = 0 Response.CacheControl = "no-cache"

你可能感兴趣的:(jsp,网络,asp)