Sep
20
CGI文件的输出控制:
输出两个expires头,最大有效时间的生效
输出两个Cache-Control头,no-cache可生效
输出两个Cache-Control的max-age,时间长的生效,跟先后没有关系
#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"
#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
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
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
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,时间长的生效,跟先后没有关系
加入动感地带阵营
台风(typhoon)

