社区
ASP
帖子详情
请问response.addheader "pragma","no-cache"是什么意思?谢谢大家?
morris_lz
2003-12-01 11:20:40
response对象的addheader方法起到什么作用?具体有哪些参数?
thanks
...全文
4002
12
打赏
收藏
请问response.addheader "pragma","no-cache"是什么意思?谢谢大家?
response对象的addheader方法起到什么作用?具体有哪些参数? thanks
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
12 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
wlm_lm
2003-12-01
打赏
举报
回复
response.addheader "pragma","no-cache" 是不要网页存于缓存之中。
相当于<meta http-equiv="pragma" content="no-cache">
vivisogood
2003-12-01
打赏
举报
回复
本地无缓存,每次自动刷新
response.expires=0
response.addheader"pragma","no-cache"
response.addheader"cache-control","private"
sacrefies
2003-12-01
打赏
举报
回复
Mozilla,传说中的所有浏览器的祖宗~
morris_lz
2003-12-01
打赏
举报
回复
Mozilla是什么意思?
paz
2003-12-01
打赏
举报
回复
http_user_agent
通过这个变量能够获得访问用户使用的浏览器类型。
morris_lz
2003-12-01
打赏
举报
回复
不好意思,还得麻烦大家一下
<%browsetype=Request.ServerVariables("HTTP_USER_AGENT")
IF Left(browsetype,11)="Mozilla/2.0" then
Response.Redirect "FancyStart.asp"
Else
Response.Redirect "OldStart.asp"
End if%>
中HTTP_USER_AGENT代表什么意思?Mozilla/2.0又是什么意思?
谢谢热心的朋友们
morris_lz
2003-12-01
打赏
举报
回复
谢谢大家:)
qxs
2003-12-01
打赏
举报
回复
这个意思,就是去掉缓存,然后刷新页面!
xzq686
2003-12-01
打赏
举报
回复
你那句话是客户端的脚本。
服务器端:
<%
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
%>
客户端:
用客户端代码使浏览器不再缓存Web页面:
<html>
<head>
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
</head>
如果使用上面的方法强制浏览器不再缓存Web页面,必须注意以下几点:
只有在使用安全连接时“Pragma: no-cache”才防止浏览器缓存页面。对于不受安全保护的页面,“Pragma: no-cache”被视为与“Expires: -1”相同,此时浏览器仍旧缓存页面,但把页面标记为立即过期。
但是在IE 4或5中,“Cache-Control”META HTTP-EQUIV标记将被忽略,不起作用。
monkeys
2003-12-01
打赏
举报
回复
楼上都说了
seayc
2003-12-01
打赏
举报
回复
alexzhang00(三角猫(sjcatsoft))
是你让我深深地理解了‘人外有人,天外有天’这句话。谢谢侬!
DeltaCat
2003-12-01
打赏
举报
回复
addheader 是发送给浏览器 HTTP 头信息
c# 注销按钮返回登录
/// /// 强制页面过期,重新向服务器请求刷新页面 /// public static void ClearClientPage
Cache
() { HttpContext.Current.
Response
.Buffer = true; HttpContext.Current.
Response
.Expires = 0; HttpContext.Current.
Response
.ExpiresAbsolute = DateTime.Now.
Add
Days(-1); HttpContext.Current.
Response
.
Add
Header
("
pragma
", "no-
cache
"); HttpContext.Current.
Response
.
Add
Header
("
cache
-control", "private"); HttpContext.Current.
Response
.
Cache
Control = "no-
cache
"; }
在(ASP/PHP/JSP/html/js)中禁止ajax缓存的方法集锦
ajax缓存有好处,但也有坏处,缓存有时候会导致误操作,影响用户体验,若你的WEB项目不需要ajax缓存功能,可按下述方法来禁止ajax缓存。 一、在ASP中禁止ajax缓存: ‘放在ASP网页最开头部分
Response
.expires=0
Response
.
add
Header
("
pragma
","no-
cache
")
Response
.
add
Header
("
Cache
-Control","no-
cache
, must-revalidate") 二、在PHP中禁止Ajax缓存: //放在PHP网页开头部分
header
("Expires: Thu, 01 Jan 1970 00:00
asp、html、js 禁止缓存的代码
ASP
Response
.Buffer = True
Response
.ExpiresAbsolute = Now() - 1
Response
.Expires = 0
Response
.
Cache
Control = no-
cache
Response
.
Add
Header
Pragma
, No-
Cache
HTML <meta http-equiv=Content-Type content=text/html; charset=gb2312 /> <meta http-equiv=
Pragma
CONTENT=no-
cache
> <meta http-
asp实现带刷新功能的验证码代码
将以下代码放到一个单独的页面checkcode.asp <% Option Explicit
Response
.buffer=true Call Com_CreatValidCode(validateCode) Sub Com_CreatValidCode(pSN) ' 禁止缓存
Response
.Expires = -9999
Response
.
Add
Header
Pragma
,no-
cache
Response
.
Add
Header
cache
-ctrol,no-
cache
Response
.ContentType = Image/BMP Randomize
Asp.net禁用页面缓存的方法总结
1、在Asp页面首部<head>加入 代码如下:
Response
.Buffer = True
Response
.ExpiresAbsolute = Now() – 1
Response
.Expires = 0
Response
.
Cache
Control = “no-
cache
”
Response
.
Add
Header
“
Pragma
”, “No-
Cache
” 2、在HtML代码中加入 代码如下: <HEAD> <META HTTP-EQUIV=”
Pragma
” CONTENT=
ASP
28,391
社区成员
357,060
社区内容
发帖
与我相关
我的任务
ASP
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
复制链接
扫一扫
分享
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章