shulidong
4/25/2017 - 1:27 AM

页面清除缓存

页面清除缓存

<!--如果需要在html页面上设置不缓存,这在<head>标签中加入如下语句:-->
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">   

<!-- 引用自http://www.cnblogs.com/liuling/p/2013-7-25-01.html $thanks残剑-->
//在springmvc中最直接的方法是设置HttpServletResponse的“Cache-contorl”属性
//http1.0
getResponse().setHeader("Pragma", "no-cache");
getResponse().setDateHeader("Expires", 0);
//http1.1
getResponse().addHeader("Cache-Control", "no-cache no-store");