[proxy]
用squid做web加速器,有个疑惑的问题,请大家指点迷津!
squid.conf文件如下:
visible_hostname cache.yidu.com
http_port 80
icp_port 0
acl QUERY urlpath_regex cgi-bin ?
no_cache deny QUERY
cache_access_log /backup/cachelog/access.log
cache_log /backup/cachelog/cache.log
referer_log /backup/cachelog/access.log
useragent_log /backup/cachelog/access.log
cache_mem 512 MB
cache_dir ufs /backup/cache 4096 16 256
cache_dir ufs /opt/cache1 4096 16 256
cache_swap_low 80
cache_swap_high 90
log_icp_queries off
buffered_logs on
emulate_httpd_log on
cache_store_log none
logfile_rotate 3
redirect_rewrites_host_header off
connect_timeout 1 minute
half_closed_clients off
client_lifetime 1 hour
acl all dst 211.100.31.0/255.255.255.0
http_access allow all
cache_mgr zhucy@yidu.com
cache_effective_user squid
cache_effective_group squid
httpd_accel_port 80
httpd_accel_host virtual
httpd_accel_with_proxy off
httpd_accel_single_host off
httpd_accel_uses_host_header on
测试可以做web加速,但是access.log出现TCP_MISS:DIRECT信息:
218.247.140.197 - - [04/Jan/2006:10:13:14 +0800] "GET http://www.kring.cn/ HTTP/1.1" 200 25861 TCP_MISS:DIRECT
1136340799.088 218.247.140.197 http://www.kring.cn/ http://www.kring.cn/dashiji.shtml
218.247.140.197 - - [04/Jan/2006:10:13:56 +0800] "GET http://www.kring.cn/ HTTP/1.1" 200 25861 TCP_MISS:DIRECT
1136340911.214 218.247.140.197 http://www.kring.cn/ http://www.kring.cn/dashiji.shtml
我查了一下,TCP_MISS:DIRECT的意思是squid没有发现缓存信息,然后去原始apache服务器去拿数据,可是着两次访问这么短的时间,等于根本不缓存嘛。
现在十分郁闷,请各位老大帮忙排查一下问题原因。
刚才把store.log也打开看了一下,访问了几个加速的页面,内容也都不能被cache,内容如下:
1136351941.029 RELEASE -1 FFFFFFFF 97A81E504E9FAD716E8FF8536F392F52 200 1136351939 -1 -1 text/html -1/17223 GET http://www.krin
g.cn/dashiji.shtml
1136351942.019 RELEASE -1 FFFFFFFF 0FB6A863C36B2896298E280C80533385 304 1136351940 -1 -1 unknown -1/0 GET http://www.kring.cn/c
ss/340515208967400642.css
1136352007.018 RELEASE -1 FFFFFFFF 16DC377E5E0554D82ACA19947E85BE81 200 1136352005 -1 -1 text/html -1/11482 GET http://www.krin
g.cn/krflash.shtml
1136352009.026 RELEASE -1 FFFFFFFF 50DEB0AFD0E9E32C727E424E9860C229 304 1136352007 -1 -1 unknown -1/0 GET http://www.kring.cn/c
ss/340515208967400642.css
1136352010.115 RELEASE -1 FFFFFFFF B3C11AFF45BCD9F828DFE6456F23B1F2 200 1136352008 -1 -1 text/html -1/11181 GET http://www.krin
g.cn/yyzp.shtml
[ 本帖最后由 我是大宇 于 2006-1-4 13:23 编辑 ]