Re: [squid-users] refresh_pattern

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 26 Aug 2009 13:28:46 +1200

On Tue, 25 Aug 2009 21:11:53 +0200, mickymax_at_gmx.de wrote:
> Hi,
>
> I am trying to fully understand the refresh algorithm Squid is using:
>
> FRESH if expires < now, else STALE
> STALE if age > max
> FRESH if lm-factor < percent, else STALE
> FRESH if age < min
> else STALE
>
> I disabled the last-modified header on my apache server for an objekt
> test.html for testing purposes.
> My refresh_pattern looks like this:
> refresh_pattern test3 10 10% 300
>
> If I request something like
> echo -e "GET http://example.com/test.html HTTP/1.0\n\n" | netcat
> example.com 80
>
> the answer from squid is
> HTTP/1.0 200 OK
> Date: Tue, 25 Aug 2009 19:01:46 GMT
> Server: Apache/2.2.6 (Unix) PHP/5.2.5
> ETag: "4d04f6-2-f4490a00"
> Accept-Ranges: bytes
> Content-Length: 2
> Content-Type: text/html
> Age: 346
> X-Cache: HIT from example.com
> Via: 1.0 example.com (squid/3.0.STABLE18)
> Connection: close
>
>
> It is strange to me that Squid always produces a hit. Since the object
does
> not have a last-modified or expires header, the Squid algorithm should
look
> simply like this:
> STALE if age > max
> FRESH if age < min
> else STALE
>
> But both: age>max and age < min do not work (no refresh of the object is
> done via Squid), Squid is still caching the object. It only changes if I
> set percent to 0%, then I receive a MISS, but percent should not be used
> (since no last-modified-header), should it?
>
> I would appreciate any explanations.

Sounds a bit like bug #7 being hit.

Also check your access.log to see what type of HIT it is.
You may be getting TCP_REFRESH_HIT (server IMS queried and it replied
'object not changed') instead of TCP_HIT (object from cache, no backend
contact). Bug #7 means the old headers can get sent on the first case.

Amos
Received on Wed Aug 26 2009 - 01:28:50 MDT

This archive was generated by hypermail 2.2.0 : Wed Aug 26 2009 - 12:00:04 MDT