On 5/09/2013 5:35 a.m., Geoffrey Schwartz wrote:
I have a page which gets cached by Firefox. Google Page Speed says it's cacheable as well. Squid does not cache it. I'm running Squid v3.3.8. My configuration is pretty standard... I'll post it if need be. The page is being served through Apache's mod_asis so I can explicitly set the headers. Here it is: ===== Status: 200 A-OK Date: Wed, 04 Sep 2013 15:32:28 GMT Cache-Control: public Expires: Thu, 05 Sep 2013 15:32:28 GMT Vary: Accept-Encoding Content-Type: text/html <html> <body> hello, world </body> </html> ===== When I visit the page in Firefox (I have to disable browser caching in order to get it to send the request in the first place), my browser sends/receives the following headers (according to Firebug): ===== GET http://example.com/test.asis HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:23.0) Gecko/20100101 Firefox/23.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive HTTP/1.1 200 OK Date: Wed, 04 Sep 2013 17:09:48 GMT Server: Apache/2.2.25 (Unix) mod_ssl/2.2.25 OpenSSL/1.0.1e DAV/2 mod_perl/2.0.7 Perl/v5.12.4 Cache-Control: public Expires: Thu, 05 Sep 2013 15:32:28 GMT Vary: Accept-Encoding Content-Length: 43 Content-Type: text/html X-Cache: MISS from webcache-dev1.cc.columbia.edu Via: 1.1 webcache-dev1.cc.columbia.edu (squid/3.3.8) Connection: keep-alive ===== I get this response every time (as in, X-Cache: MISS). I know the Date header gets changed (probably by apache using the last-modified time) as well as the Status, but the Expires header is still there (and still in the future). This should be cached, right? Apparently Google's Page Speed tool and Firefox think so. Out of curiosity, I removed the Vary header. Squid then started caching the page. Did I run into a bug with 3.3.8? I did several searches but wasn't able to find anything about this issue.
You did. There is something very strange happening with the special cache Vary-marker object used to identify different variants of the object behind the URL. for some reason those are not being cached for very long by by 3.2 and later which prevents the variants being HIT on sometimes.
Amos