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

 // 防止缓存       
//Forces caches to obtain a new copy of the page from the origin server
response.setHeader("Cache-Control","no-cache"); 
//Directs caches not to store the page under any circumstance
response.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");

你可能感兴趣的:(html,xml,cache)