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 /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 /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 /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 /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: , ,
发表评论
AD
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML 打开UBB 打开表情 隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

 

阅读推荐

服务器相关推荐

开发相关推荐

应用软件推荐