Squid Caching Issue

Hi frnds

I recently configured Squid 2.5 stable version on my redhat machine.Caches are storing in my disk (/var/spool/squid) but my access.log file always shows tcp_miss for every site i access as well as store.log file shows release on every action.

some of the records of my access.log and store.log below

1343135194.811 587 192.168.2.200 TCP_MISS/200 381 GET http://imp2.bizographics.com/u? - DIRECT/46.137.190.51 image/gif
1343135194.826 587 192.168.2.200 TCP_MISS/200 547 GET http://imp2.bizographics.com/m/1640? - DIRECT/46.137.190.51 image/gif
1343135194.881 54 192.168.2.200 TCP_HIT/200 1512 GET http://windowsnetworking.com/favicon.ico - NONE/- image/x-icon
1343135426.016 240555 192.168.2.200 TCP_MISS/200 2164 CONNECT ssl.gstatic.com:443 - DIRECT/74.125.236.207 -
1343135442.466 414978 192.168.2.200 TCP_MISS/200 16961 CONNECT clients4.google.com:443 - DIRECT/74.125.236.206 -
1343135937.361 2086371 192.168.2.200 TCP_MISS/200 3553 CONNECT talkx.l.google.com:443 - DIRECT/74.125.31.125 -
1343139319.977 5 192.168.2.200 TCP_DENIED/403 1379 CONNECT talk.google.com:5222 - NONE/- text/html
1343139319.993 3 192.168.2.200 TCP_DENIED/403 1379 CONNECT talk.google.com:5222 - NONE/- text/html
1343139331.360 412 192.168.2.200 TCP_MISS/200 534 GET http://www.google.co.in/complete/search? - DIRECT/74.125.236.223 text/javascript

Store.log :

1342965073.256 RELEASE 00 00000001 0938C2B8D0DBCC4C669AF870E3DD36B5 200 1342965061 1341275318 1374501061 text/css 156961/57165 GET http://kaw.stc.s-msn.com/br/sc/css/6c/48cc7d99012394221cd9d18651c16d_2.css
1342965073.533 SWAPOUT 00 00000002 3A633302BF3254AC0C9ED1D08F14A7BF 200 1342965063 1340762253 1374501063 text/css 5560/5560 GET http://kaw.stc.s-msn.com/br/sc/css/b2/a83980391bc35a7893661134a7ea15.css
1342965073.684 RELEASE -1 FFFFFFFF 84CE9F9E4BFA5A158E8AB36AAD590BC2 302 1342965064 -1 -1 text/html 221/221 GET Google
1342965074.358 RELEASE -1 FFFFFFFF C51DD3E93A93E944A3C5176A102E241D 200 1342965064 -1 1342965064 text/html -1/26493 GET Google
1342965075.236 SWAPOUT 00 00000003 BB6B298E4D609EB01E6F67BCE180AB93 200 1342965075 -1 1343065075 x-squid-internal/vary -1/222 GET http://www.google.co.in/xjs/\_/js/s/s,st,anim,jsa,sb\_he,hv,pj,ssb,tbpr,tbui,rsn,ob,mb,lc,du,ada,lu,pcc,csitl/rt=j/ver=l3lFqRj\_rDg.en\_US./d=1/rs=AItRSTNd2xM7N-7jiWER5XvKUf_O9OtaVQ
1342965079.429 SWAPOUT 00 00000004 71AFF93FB9741A0654B2DCA3321BC10C 200 1342707471 1342572579 1374243471 text/javascript -1/222537 GET http://www.google.co.in/xjs/\_/js/s/s,st,anim,jsa,sb\_he,hv,pj,ssb,tbpr,tbui,rsn,ob,mb,lc,du,ada,lu,pcc,csitl/rt=j/ver=l3lFqRj\_rDg.en\_US./d=1/rs=AItRSTNd2xM7N-7jiWER5XvKUf_O9OtaVQ
1342965079.851 RELEASE -1 FFFFFFFF 0B0F491F0F1E701C3DCEE027A8651B47 200 1342965070 -1 631152000 text/html -1/594 GET http://www.google.co.in/compressiontest/gzip.html
1342965080.497 RELEASE -1 FFFFFFFF 7270BE16C5EBD35A57F4E5EE0CBCDF02 204 1074714690 -1 180221530 image/gif 0/0 GET http://www.google.co.in/csi?
1342966031.208 SWAPOUT 00 00000007 29FEB427AD0A2704134CAC9498F73DBD 200 1342966902 1335305615 1368342017 text/css 103/103 GET http://b.static.ak.fbcdn.net/rsrc.php/v2/yY/r/u8iA3kXb8Y1.css

i tried to change the refresh_pattern also but still showing the same.

Please help me

Vaibhav

This may not be wrong; dynamically-generated websites and the like probably won't be cached. Try downloading an image twice to see if the retrieval is cached the second time.

Hii

I tried with some static websites and now logs showing TCP_Refresh_HIT or TCP_IMS_HIT but not TCP_HIT on any object.

pls suggest

Vaibhav

Try it on something actually static, like an image file, and see what happens.

Hii

trying to access image file but Same result (TCP_Miss) and TCP_Refresh_HIT showing Direct access

is anything wrong with Refresh_pattern

pls suggest

Vaibhav

I can't see your config file from here, sorry. Could you post it(stripping out comments and blank lines)?

My squid.conf basic configuration :

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT

acl mynetwork src 192.168.5.0/255.255.255.0

http_access allow mynetwork

http_access allow localhost

http_access deny all

http_port 3128
icp_port 0

cache_mem 64MB

cache_dir ufs /var/spool/squid 2000 16 256

maximum_object_size 40960 KB

access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log

debug_options ALL,1 33,2 28,9

client_netmask 255.255.255.255

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320

cache_mgr admin@mydomain.inernal

visible_hostname mydomain.internal

dns_nameservers 192.168.x.x 192.168.x.x

ipcache_size 10000
fqdncache_size 10000

client_db off