Re: [squid-users] Re: Negative Caching not working on 3.1.6?

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Fri, 07 Jan 2011 19:03:43 +1300

On 31/12/10 10:40, Chas Williams wrote:
> Err, my mail client ate my formatting -- that refresh_pattern is all
> on one line in my squid.conf file.
>
> Also, FYI, these logs are all for squid straight from the ubuntu
> repos, but I saw the same problem when compiling from source with the
> latest stable version (3.1.10).
>
> On Thu, Dec 30, 2010 at 1:37 PM, Chas Williams<chas_at_seomoz.org> wrote:
>> Hi Curl,
>>
>> I'm trying configure squid to cache everything for a minimum
>> amount of time, no matter what (I release this is a bit of a
>> bastardization of it's purpose and of the http spec -- I'm trying to
>> use it as a cache for another program I'm working on, in a space where
>> this is reasonable).
>>
>> I can't seem to make negative caching work -- below are (1) the
>> send and receive headers from a curl request for a URL that 404s,
>> twice (to show that the second is a cache miss), (2) version
>> information (of squid and my box), (3) my squid.conf file, and (4) my
>> access, cache, and store logs. These are all from a fresh install on a
>> new box.
>>
>> Any ideas?
>>
>> Thanks,
>>
>> Chas Williams
>>
>> P.S. for bonus points, can anyone tell me if my squid.conf will really
>> cache everything for at least 240 minutes?
>>
>> ----------------------------------------------------------------------------------------------------------------------------
>> ubuntu_at_domU-12-31-39-0C-81-A1:~$ curl -x localhost:3128 -v
>> "http://hotelburst.es/robots.txt">/dev/null
>> * About to connect() to proxy localhost port 3128 (#0)
>> * Trying 127.0.0.1... % Total % Received % Xferd Average Speed
>> Time Time Time Current
>> Dload Upload Total Spent Left Speed
>> 0 0 0 0 0 0 0 0 --:--:-- --:--:--
>> --:--:-- 0connected
>> * Connected to localhost (127.0.0.1) port 3128 (#0)
>>> GET http://hotelburst.es/robots.txt HTTP/1.1
>>> User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
>>> Host: hotelburst.es
>>> Accept: */*
>>> Proxy-Connection: Keep-Alive
>>>
>> * HTTP 1.0, assume close after body
>> < HTTP/1.0 404 Not Found
>> < Date: Thu, 30 Dec 2010 21:18:14 GMT
>> < Server: Apache/2.2.3 (Debian) mod_jk/1.2.18 mod_python/3.2.10
>> Python/2.4.4 PHP/5.2.0-8+etch15 mod_ssl/2.2.3 OpenSSL/0.9.8c
>> mod_perl/2.0.2 Perl/v5.8.8
>> < Content-Length: 406
>> < Content-Type: text/html; charset=iso-8859-1
>> < X-Cache: MISS from localhost
>> < X-Cache-Lookup: MISS from localhost:3128
>> < Via: 1.0 localhost (squid/3.1.6)
>> * HTTP/1.0 proxy connection set to keep alive!
>> < Proxy-Connection: keep-alive
>> <
>> { [data not shown]
>> 100 406 100 406 0 0 1303 0 --:--:-- --:--:--
>> --:--:-- 1309* Connection #0 to host localhost left intact
>> * Closing connection #0
>> ubuntu_at_domU-12-31-39-0C-81-A1:~$ curl -x localhost:3128 -v
>> "http://hotelburst.es/robots.txt">/dev/null
>> * About to connect() to proxy localhost port 3128 (#0)
>> * Trying 127.0.0.1... % Total % Received % Xferd Average Speed
>> Time Time Time Current
>> Dload Upload Total Spent Left Speed
>> 0 0 0 0 0 0 0 0 --:--:-- --:--:--
>> --:--:-- 0connected
>> * Connected to localhost (127.0.0.1) port 3128 (#0)
>>> GET http://hotelburst.es/robots.txt HTTP/1.1
>>> User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
>>> Host: hotelburst.es
>>> Accept: */*
>>> Proxy-Connection: Keep-Alive
>>>
>> * HTTP 1.0, assume close after body
>> < HTTP/1.0 404 Not Found
>> < Date: Thu, 30 Dec 2010 21:18:16 GMT
>> < Server: Apache/2.2.3 (Debian) mod_jk/1.2.18 mod_python/3.2.10
>> Python/2.4.4 PHP/5.2.0-8+etch15 mod_ssl/2.2.3 OpenSSL/0.9.8c
>> mod_perl/2.0.2 Perl/v5.8.8
>> < Content-Length: 406
>> < Content-Type: text/html; charset=iso-8859-1
>> < X-Cache: MISS from localhost
>> < X-Cache-Lookup: HIT from localhost:3128

This is a 404 HIT on the second fetch.

"negative_ttl 240 minute" and "refresh_pattern . 240 999%
" and all the override-* and ignore-* turned on will do that.
And yes great care is needed not to screw things up badly due to the
non-compliance.

minimum_expiry_time defaults to 60 seconds. It can be raised a bit
without violation.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.10
   Beta testers wanted for 3.2.0.4
Received on Fri Jan 07 2011 - 06:03:49 MST

This archive was generated by hypermail 2.2.0 : Fri Jan 07 2011 - 12:00:02 MST