2006年12月9日

使用linux 的wget 指令測試proxy是否有cache到頁面

1.proxy沒cache到頁面

--20:49:37-- http://210.65.0.1/report/2006vote/chinatimes/MayorVote.xml?r=19-45
=> `MayorVote.xml?r=19-45'
Connecting to 210.65.0.1:80... connected.
HTTP request sent, awaiting response...
1 HTTP/1.0 200 OK
2 Content-Length: 19613
3 Content-Type: text/xml
4 Last-Modified: Sat, 09 Dec 2006 12:44:04 GMT
5 Accept-Ranges: bytes
6 ETag: W/"bc758bb58f1bc71:3d9"
7 Server: Microsoft-IIS/6.0
8 X-Powered-By: ASP.NET
9 Date: Sat, 09 Dec 2006 12:49:34 GMT
10 X-Cache: MISS from ac200 (沒有cache 到頁面 )
11 Connection: keep-alive
100%[====================================>] 19,613 --.--K/s
20:49:39 (36.68 MB/s) - `MayorVote.xml?r=19-45.2' saved [19613/19613]
2.proxy有cache到頁面

--20:56:50-- http://210.65.0.1/report/2006vote/chinatimes/MayorVote.xml
=> `MayorVote.xml.1'
Connecting to 210.65.0.1:80... connected.
HTTP request sent, awaiting response...
1 HTTP/1.0 200 OK
2 Content-Length: 19613
3 Content-Type: text/xml
4 Last-Modified: Sat, 09 Dec 2006 12:44:04 GMT
5 Accept-Ranges: bytes
6 ETag: W/"bc758bb58f1bc71:3d9"
7 Server: Microsoft-IIS/6.0
8 X-Powered-By: ASP.NET
9 Date: Sat, 09 Dec 2006 12:56:42 GMT
10 Age: 13
11 X-Cache: HIT from ac200 (有cache,ac200是proxy server的hostname)
12 Connection: keep-alive
100%[====================================>] 19,613 --.--K/s
20:56:51 (34.13 MB/s) - `MayorVote.xml.1' saved [19613/19613]
cache控制參數(有可能是proxy server加進去的http header):
  Cache-Control: max-age=60  (cache 60秒,如果超過 60會回304,要求確認是否更新過)
   X-Cache: HIT from ac200  (在ac200 有cache到)
 

沒有留言: