禁用浏览器缓存

Java 代码 设置response header

 

        response.setDateHeader("Expires", 0);
        response.setHeader("Cache-Control", "no-cache");
        response.setHeader("Pragma", "no-cache");

 

HTML在head设置

<meta http-equiv="Expires" content="0" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />

 

posted @ 2015-05-09 10:46  rubekid  阅读(114)  评论(0编辑  收藏  举报