wh@xxxxxxxxx wrote:
Hello. Today I was looking at my access.log file trying to test how is my squid conf behaving. I noticed that not much of the requested pages get cached, this means even google.com. I ran the following command just to see if some of the pages are getting served locally or being requested by squid: tail -f /var/log/squid/access.log | grep TCP_HIT I request a page the first time and, ok, it doesn't get a hit since is not cached. Now, I clear my local browser cache and try again. This time the page still doesn't get cached, not even an image does. I check the page's code and I don't see the no-cache meta in it.
Squid is an HTTP proxy. The page code is not relevant to Squid and is ignored.
The HTTP protocol headers contain Cache-Control: header with controls Squid uses for storage decisions amongst other things. I know that google.com do set non-cachable in their Cache-Control: for their pages, even the first.
I would suggest entering any URL you want to check into the tester at http://www.redbot.org/
Amos
Why is not getting cached? I've read that only 20% of the stuff gets cached. Is that correct? Please help me optimize my squid server. Thanks in advanced. Here's my squid.conf file: # Port Squid listens on http_port 192.168.2.1:3128 transparent # Access-lists (ACLs) will permit or deny hosts to access the proxy acl lan-access src 192.168.2.0/255.255.255.0 acl localhost src 127.0.0.1 #acl all src 0.0.0.0/0.0.0.0 acl CONNECT method CONNECT # Access rule http_access allow localhost http_access allow lan-access maximum_object_size 64000 KB cache_mem 256 MB access_log /var/log/squid/access.log cache_log /var/log/squid/cache.log cache_store_log /var/log/squid/store.log cache_dir ufs /var/log/squid/cache 40000 255 255 htcp_port 0 icp_port 0 extension_methods SEARCH NICK quick_abort_min -1 KB negative_ttl 1 minutes connect_timeout 90 seconds dns_nameservers 196.3.81.5 200.88.127.22 196.3.81.132 logfile_rotate 5 refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern (cgi-bin|\?) 0 0% 0 refresh_pattern . 0 20% 4320
-- Please be using Current Stable Squid 2.7.STABLE6 or 3.0.STABLE16 Current Beta Squid 3.1.0.10 or 3.1.0.11