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

在html页头设置不缓存

时间:2016-05-26 16:04:01      阅读:400      评论:0      收藏:0      [点我收藏+]

标签:

 方法一:在<head>标签里增加如下meta标签。

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache" content="no-cache">

 方法二:在java代码中增加如下代码。

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

 

在html页头设置不缓存

标签:

原文地址:http://www.cnblogs.com/ShoneH/p/5531456.html

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