On 21/04/2014 5:10 p.m., Timur Irmatov wrote: > Hi. > > I am trying to understand why my Squid 3.4 refuses to cache some URLs. > Here is an example: > > curl -I http://guard.cdnmail.ru/GuardMailRu.exe > HTTP/1.1 200 OK > Server: nginx > Date: Mon, 21 Apr 2014 05:02:28 GMT > Content-Type: application/octet-stream > Last-Modified: Fri, 04 Apr 2014 14:34:09 GMT > Accept-Ranges: bytes > Content-Length: 6779936 > X-Cache: MISS from 1 > Connection: keep-alive > > As you see, response does not have explicit lifetime so it should be > cacheable based on Last-Modified and refresh_pattern directive. My > config is: > > cache_effective_user proxy > acl clients src X.X.X.X/Y > acl CONNECT method CONNECT > http_access deny CONNECT > http_access allow localhost manager > http_access deny manager > http_access allow clients > http_access allow localhost > http_access deny all > http_port 3128 > http_port 3129 tproxy Possibility #1: Is you cache.log containing any messages about Host header forgery? Traffic suspected of forgery is not cached, in order to avoid poisoning other clients. > cache_dir ufs /srv/squid3/1 90000 16 256 > cache_dir ufs /srv/squid3/2 90000 16 256 > cache_dir ufs /srv/squid3/3 90000 16 256 > cache_dir ufs /srv/squid3/4 90000 16 256 > cache_dir ufs /srv/squid3/5 490000 16 256 > store_dir_select_algorithm round-robin > maximum_object_size 100 MB Possibility #2: Object size limits need to be set in or before the cache_dir lines. The default limit is 4MB and I notice your test object is over 6MB. > coredump_dir /opt/squid/var/cache/squid > refresh_pattern ^ftp: 1440 20% 10080 > refresh_pattern ^gopher: 1440 0% 1440 > refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 > refresh_pattern . 0 20% 86400 > via off > global_internal_static off > dns_nameservers 192.168.0.1 > dns_v4_first on > forwarded_for transparent > visible_hostname 1 > unique_hostname 1 > store_id_program /opt/squid/etc/helpers/storeid /opt/squid/etc/cacheurl.config > store_id_children 1 startup=1 idle=1 concurrency=1000 > > When I repeatedly request aforementioned URL with wget I consistently > get TCP_MISS. What am I doing wrong? :) > Possibility #3: Your test tool may be sending headers to Squid telling it not to use the cached object. Curl is known for this. You will need to check the *request* header for Cache-Control to see this. Amos