码迷,mamicode.com
首页 > Web开发 > 详细

JSP设置无缓存

时间:2014-08-25 19:19:45      阅读:242      评论:0      收藏:0      [点我收藏+]

标签:jsp设置无缓存

1.<%
   //设置无缓存
   response.setHeader("progma","no-cache");   
   response.setHeader("Cache-Control","no-cache");   
   response.setDateHeader("Expires",0);
   %>

2.设置页面Nocache方式,即每次访问此页面,均需要从服务器重新读取,而不是使用缓存中存在的此页面。

在jsp页面的<head></head>中间添加如下代码。

<meta http-equiv="pragma" content="no-cache"> 

<meta http-equiv="cache-control" content="no-cache"> 

<meta http-equiv="expires" content="0">   

JSP设置无缓存

标签:jsp设置无缓存

原文地址:http://blog.csdn.net/benjamin_whx/article/details/38824251

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!