Sep 20

文件头过期控制的不同效果 不指定

hqlulu , 20:52 , 技术分享 » Server , 评论(0) , 引用(0) , 阅读(176) , Via 本站原创 | |
CGI文件的输出控制:

#echo "Expires: Mon, 26 Jul 1997 05:00:00 GMT"
#echo "Cache-Control: no-cache, must-revalidate"
#echo "Cache-Control: max-age=200"
#echo "Pragma: no-cache"


引用
[root@gx ~]# curl -I http://pic.aslibra.com/cgi-bin/test1.cgi
HTTP/1.0 302 Moved Temporarily
Expires: Sat, 20 Sep 2008 12:04:19 GMT
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: max-age=120
Location: http://test.aslibra.com/cgi-bin/test1.cgi
Date: Sat, 20 Sep 2008 12:02:19 GMT
Server: lighttpd/1.4.15
Age: 6
X-Cache: HIT from No1.proxy
Connection: close


输出两个expires头,最大有效时间的生效

引用
[root@gx ~]# curl -I http://pic.aslibra.com/cgi-bin/test1.cgi?
HTTP/1.0 302 Moved Temporarily
Expires: Sat, 20 Sep 2008 12:07:29 GMT
Cache-Control: max-age=120
Cache-Control: no-cache, must-revalidate
Location: http://test.aslibra.com/cgi-bin/test1.cgi?
Date: Sat, 20 Sep 2008 12:05:29 GMT
Server: lighttpd/1.4.15
X-Cache: MISS from No1.proxy
Connection: close


输出两个Cache-Control头,no-cache可生效

引用
[root@gx ~]# curl -I http://pic.aslibra.com/cgi-bin/test1.cgi?1
HTTP/1.0 302 Moved Temporarily
Expires: Sat, 20 Sep 2008 12:08:38 GMT
Cache-Control: max-age=120
Cache-Control: max-age=10
Location: http://test.aslibra.com/cgi-bin/test1.cgi?1
Date: Sat, 20 Sep 2008 12:06:38 GMT
Server: lighttpd/1.4.15
Age: 13
X-Cache: HIT from No1.proxy
Connection: close

[root@gx ~]# curl -I http://pic.aslibra.com/cgi-bin/test1.cgi?6
HTTP/1.0 302 Moved Temporarily
Expires: Sat, 20 Sep 2008 12:38:25 GMT
Cache-Control: max-age=120
Cache-Control: max-age=200
Location: http://test.aslibra.com/cgi-bin/test1.cgi?6
Date: Sat, 20 Sep 2008 12:36:25 GMT
Server: lighttpd/1.4.15
Age: 122
X-Cache: HIT from No1.proxy
Connection: close


输出两个Cache-Control的max-age,时间长的生效,跟先后没有关系


Tags: , ,
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]