龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > Javascript编程 >

ajax,asp,html,php 禁止页面缓存方法

时间:2012-12-29 08:41来源:未知 作者:admin 点击:
分享到:
下面介绍几种禁止页面缓存的有效方法,有需要的朋友可以参考一下。 标准方法,直接写在html里面 代码如下 META HTTP-EQUIV=pragma CONTENT=no-cache META HTTP-EQUIV=Cache-Control CONTENT=no-cache, must-rev
下面介绍几种禁止页面缓存的有效方法,有需要的朋友可以参考一下。

标准方法,直接写在html里面

 代码如下

<META   HTTP-EQUIV="pragma"   CONTENT="no-cache"> 
<META   HTTP-EQUIV="Cache-Control"   CONTENT="no-cache,   must-revalidate"> 
<META   HTTP-EQUIV="expires"   CONTENT="Wed,   26   Feb   1997   08:21:57   GMT"> 

ajax禁止页面缓存

 代码如下

Response.Cache.SetCacheability(HttpCacheability.NoCache);


htm网页

 代码如下
<metahttp-equiv="pragma"content="no-cache">
<metahttp-equiv="cache-control"content="no-cache,must-revalidate">
<metahttp-equiv="expires"content="wed,26feb199708:21:57gmt">
或者<metahttp-equiv="expires"content="0">

asp教程网页

 代码如下
response.expires=-1
response.expiresabsolute=now()-1
response.cachecontrol="no-cache"

php教程网页

 代码如下
header("expires:mon,26jul199705:00:00gmt");
header("cache-control:no-cache,must-revalidate");
header("pragma:no-cache");

精彩图集

赞助商链接