首页 > 运营 > 建站经验 > 正文

如何让网页过期,无法回退

2023-05-09 20:01:14
字体:
来源:转载
供稿:网友

可以直接用 HTML 的 META 来实现。

放入 HTML 的 HEAD 部分
<!--禁用缓存部分开始-->
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Progma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache,must-revalidate" />
<!--禁用缓存部分结束-->


ASP 代码如下:
放在页面代码的头部
Response.Expires = 0
Response.ExpiresAbsolute = Now - 1
Response.AddHeader "progma", "no-cache"
Response.AddHeader "cache-control", "private"
Response.CacheControl = "no-cache"

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