首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

response防止页面缓存跟重设响应头部

2012-11-05 
response防止页面缓存和重设响应头部// 防止缓存//Forces caches to obtain a new copy of the page from

response防止页面缓存和重设响应头部

 // 防止缓存       //Forces caches to obtain a new copy of the page from the origin serverresponse.setHeader("Cache-Control","no-cache"); //Directs caches not to store the page under any circumstanceresponse.setHeader("Cache-Control","no-store"); //HTTP 1.0 backward compatibility response.setHeader("Pragma","no-cache"); //Causes the proxy cache to see the page as "stale"response.setDateHeader("Expires", 0);              // 重新设置响应头部response.setContentType("text/html;charset=UTF-8");// response.setContentType("text/xml;charset=UTF-8");

热点排行