各类常见语言清除网页缓存方法汇总
时间:2021-04-09 09:02:28|栏目:|点击: 次
本文实例汇总了各类常见语言清除网页缓存方法。分享给大家供大家参考。具体实现方法如下:
一般来说,清除缓存我们只需要设置页面为no-cache就可以了,当然像asp,php这种只需要设置Expires操作即可,具体如下。
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">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
或者
复制代码 代码如下:
<META HTTP-EQUIV="expires" CONTENT="0">
ASP网页:
复制代码 代码如下:
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
PHP网页:
复制代码 代码如下:
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
JSP网页:
复制代码 代码如下:
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 1);
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 1);
希望本文所述对大家的web程序设计有所帮助。
上一篇:教你读懂路由表
栏 目:
下一篇:Powershell小技巧之通过EventLog查看近期电脑开机和关机时间
本文标题:各类常见语言清除网页缓存方法汇总
本文地址:http://www.codeinn.net/misctech/97954.html






