首页 > 开发 > PHP > 正文

清除网页缓存(html asp php java)

2024-05-04 22:00:04
字体:
来源:转载
供稿:网友

清除缓存我们只需要设置页面为no-cache就可以了,当然像asp,php这种只需要设置Expires操作即可,具体如下.

HTML网页:

  1. <META HTTP-EQUIV="pragma" CONTENT="no-cache"
  2. <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"
  3. <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"
  4. 或者<META HTTP-EQUIV="expires" CONTENT="0"

ASP网页:

  1. Response.Expires = -1 
  2. Response.ExpiresAbsolute = Now() - 1 
  3. Response.cachecontrol = "no-cache" 

PHP网页:

  1. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
  2. header("Cache-Control: no-cache, must-revalidate"); 
  3. header("Pragma: no-cache"); //开源软件:Vevb.com 

JSP网页

  1. response.setHeader("Pragma""No-cache"); 
  2. response.setHeader("Cache-Control""no-cache"); 
  3. response.setDateHeader("Expires", 1);

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表