测试某url是否被squid 缓存

本地cache有的时候,下面指令返回【X-Cache: HIT from dfff-221】
[root@localhost logs]# /usr/local/squid/bin/squidclient -m head -p 80 http://www.xxx.com:80/21eaa3ee7b409073ca8c288826e4948c16665744.flv
HTTP/1.0 200 OK
Content-Type: video/x-flv
Accept-Ranges: bytes
ETag: "982677053"
Last-Modified: Tue, 14 Oct 2008 01:30:32 GMT
Content-Length: 2102923
Date: Thu, 29 Oct 2009 01:38:21 GMT
Server: Apache 1.3.29
Age: 23855
X-Cache: HIT from dfff-221
Via: 1.0 dfff-221:80 (sinuid/150.12)
Connection: close


本地cache没有的时候,下面指令返回【X-Cache: MISS from dfff-221】
[root@localhost logs]# /usr/local/squid/bin/squidclient -m head -p 80 http://www.xxx.com:80/21eaa3ee7b409073ca8c288826e4948c16665744.flv
HTTP/1.0 200 OK
Content-Type: video/x-flv
Accept-Ranges: bytes
ETag: "982677053"
Last-Modified: Tue, 14 Oct 2008 01:30:32 GMT
Content-Length: 2102923
Date: Thu, 29 Oct 2009 08:16:07 GMT
Server: Apache 1.3.29
X-Cache: MISS from dfff-221
Via: 1.0 dfff-221:80 (sinuid/150.12)
Connection: close

 

[root@localhost logs]# telnet 127.0.0.1 80Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
HEAD http://hb1.dhot.v.iask.com:80/f/1/f6766991b2d79140dc2eb2105188b3d125568640.flv HTTP/1.1
 
HTTP/1.0 200 OK
Content-Type: video/x-flv
Accept-Ranges: bytes
ETag: "51758042"
Last-Modified: Thu, 29 Oct 2009 06:51:34 GMT
Content-Length: 11314213
Date: Thu, 29 Oct 2009 08:52:13 GMT
Server: Apache 1.3.29
X-Cache: MISS from tj164-221
Via: 1.0 tj164-221:80 (sinuid/150.12)
Connection: close
 
Connection closed by foreign host.

 

所以用phg的get_header应该也可以测量

你可能感兴趣的:(apache,Date,cache,测试,url,character)