设置浏览器不缓存
为了指示IE浏览器(客户端)不要缓存页面,服务器端的程序可以编写如下:response.setHeader(“Cache-Control”,“no-cache”);
response.setHeader(“Pragma”,“no-cache”);作用相当于上行代码,通常两者合用
publicstaticvoidsetNoCache(HttpServletRequestrequest,HttpServletResponseresponse){
if(request.getProtocol().compareTo("HTTP/1.0")==0){
response.setHeader("Pragma","no-cache");
}elseif(request.getProtocol().compareTo("HTTP/1.1")==0){
response.setHeader("Cache-Control","no-cache");
}
response.setDateHeader("Expires",0);
}
相关推荐
ThinkMake 2020-11-13
学习web前端 2020-11-09
天空一样的蔚蓝 2020-10-23
curiousL 2020-08-03
sochrome 2020-07-29
SoarFly00 2020-06-28
jjddrushi 2019-12-09
LeoHan 2020-06-02
拭血 2020-06-02
lengyu0 2020-05-20
GimmeS 2020-05-15
逸璞丷昊 2020-03-08
lengyu0 2020-05-10
viewerlin 2020-05-10
DAV数据库 2020-05-07
程序员俱乐部 2020-05-06
Vampor 2020-05-01
ROES 2020-04-22