Sorry, Amos, it seems my latest reply was ambiguous. I tried to inform, that while debugging the issue I have found the cause. It was default value for 'minimum_expire_time'. On Wed, 2016-10-26 at 23:58 +1300, Amos Jeffries wrote: > On 26/10/2016 7:21 p.m., Garri Djavadyan wrote: > > > > On Wed, 2016-08-24 at 19:09 +0500, Garri Djavadyan wrote: > > > > > > On Mon, 2016-08-22 at 16:46 +0500, Garri Djavadyan wrote: > > > > > > > > > > > > Hello Squid users, > > > > > > > > Can anyone explain, why Squid doesn't cache the objects with > > > > max- > > > > age > > > > values below 60 seconds? > > Several possible reasons... > > > > > For example: > > > > > > > > > > > > > > > $ http_proxy="127.0.0.1:3128" curl --head "http://sandbox.comne > > > > t.lo > > > > ca > > > > l/ > > > > cgi-bin/hello.cgi" && date > > > > HTTP/1.1 200 OK > > > > Date: Mon, 22 Aug 2016 11:31:16 GMT > > > > Server: Apache > > > > Cache-Control: max-age=60 > > > > Content-Type: text/plain > > > > X-Cache: MISS from gentoo.comnet.uz > > > > Via: 1.1 gentoo.comnet.uz (squid/3.5.20) > > > > Connection: keep-alive > > > > > > > > Mon Aug 22 16:31:19 UZT 2016 > > > > > > 1) This is not a GET request. > > There is no object data returned on a HEAD request. So Squid does not > have anything to cache. > > If you did a GET before this request, then the caching time is > relative > to that request, not this one. It is not true. Squid successfully caches HEAD requests. $ for i in 1 2 ; do http_proxy="127.0.0.1:3128" \ curl --head http://sandbox.comnet.local/cgi-bin/5mb.cgi \ 2>/dev/null | grep X-Cache; done X-Cache: MISS from gentoo.comnet.uz X-Cache: HIT from gentoo.comnet.uz > 2) There is no Last-Modified header. > > Squid older than 3.5.22 do not revalidate properly with only a Date > header. Meaning new content is required fetching if the cached object > was stale. 'Date' + 'Cache-Control: max-age=70' worked as expected. 'Date' + 'Cache-Control: max-age=60' does not worked. > 3) The response to a HEAD request is supposed to be the headers that > would be sent in an equivalent GET. So the servers upstream response > headers are the right output here in light of (2) and/or (1). > > > > > > > > > > > > > > --- > > > > > > > > $ http_proxy="127.0.0.1:3128" curl --head "http://sandbox.comne > > > > t.lo > > > > ca > > > > l/ > > > > cgi-bin/hello.cgi" && date > > > > HTTP/1.1 200 OK > > > > Date: Mon, 22 Aug 2016 11:31:23 GMT > > > > Server: Apache > > > > Cache-Control: max-age=60 > > > > Content-Type: text/plain > > > > X-Cache: MISS from gentoo.comnet.uz > > > > Via: 1.1 gentoo.comnet.uz (squid/3.5.20) > > > > Connection: keep-alive > > > > > > > > Mon Aug 22 16:31:26 UZT 2016 > > > > > > > > > > > > No problems with values above 60 seconds. For example: > > > > > > > > $ http_proxy="127.0.0.1:3128" curl --head "http://sandbox.comne > > > > t.lo > > > > ca > > > > l/ > > > > cgi-bin/hello.cgi" && date > > > > HTTP/1.1 200 OK > > > > Date: Mon, 22 Aug 2016 11:36:06 GMT > > > > Server: Apache > > > > Cache-Control: max-age=70 > > > > Content-Type: text/plain > > > > X-Cache: MISS from gentoo.comnet.uz > > > > Via: 1.1 gentoo.comnet.uz (squid/3.5.20) > > > > Connection: keep-alive > > > > > > > > Mon Aug 22 16:36:09 UZT 2016 > > > > > > > > --- > > > > > > > > $ http_proxy="127.0.0.1:3128" curl --head "http://sandbox.comne > > > > t.lo > > > > ca > > > > l/ > > > > cgi-bin/hello.cgi" && date > > > > HTTP/1.1 200 OK > > > > Date: Mon, 22 Aug 2016 11:36:06 GMT > > > > Server: Apache > > > > Cache-Control: max-age=70 > > > > Content-Type: text/plain > > > > Age: 5 > > > > X-Cache: HIT from gentoo.comnet.uz > > > > Via: 1.1 gentoo.comnet.uz (squid/3.5.20) > > > > Connection: keep-alive > > > > > > > > Mon Aug 22 16:36:11 UZT 2016 > > > > > > > > > > > > As you can see, time difference between origin server and > > > > localhost > > > > is > > > > 3 seconds (UZT is +5 offset). > > Your interpretation of the timestamps is flawed. > > The message header contains teh timestamp the servre generated teh > message. > The 'date' tool produces the timestamp at teh time the transaction > delivering it was completed. > > All that is evident is that the transaction took ~5 seconds from > message > generation to completion of delivery. That may contain any amount of > +N > or -N difference in the three machines clocks (server, proxy, and > client). I showed the output of 'date' tool to confirm that Squid received fresh object. The client and Squid ran on the same machine. Garri _______________________________________________ squid-users mailing list squid-users@xxxxxxxxxxxxxxxxxxxxx http://lists.squid-cache.org/listinfo/squid-users