[squid-users] Re: refresh patterns!

From: RW <fbsd06@dont-contact.us>
Date: Wed, 15 Aug 2007 14:11:08 +0100

On Wed, 15 Aug 2007 07:18:19 +0200
Henrik Nordstrom <henrik@henriknordstrom.net> wrote:

> On tis, 2007-08-14 at 21:57 +0100, RW wrote:
>
> > I'm talking about overriding the default for query urls.
>
> Ah, those suggested defaults..
>
> > I was wondering how safe, and how useful something like this would
> > be:
> >
> > acl cache_upr urlpath_regex -i
> > \.(png|jpe?g|gif|tif+|ico|css|js|swf|swv)($|&) cache allow cache_upr
> > acl QUERY urlpath_regex cgi-bin \?
> > cache deny QUERY
>
> Provided you always usa a min-age of 0 in refresh_pattern the cache
> block of cgi-bin and query URLs is not needed at all.

That's a subtlety that seems to be lost on most people, I've never
seen anyone suggest that youtube style sites be handled by removing
"cache deny QUERY" altogether, and leaving it to the refresh rules. And
from what you are saying that sounds like the best way of handling them.

> The rules exists because of this:
>
> RFC 2616 13.9 Side Effects of GET and HEAD
>
> We note one exception to this rule: since some applications have
> traditionally used GETs and HEADs with query URLs (those
> containing a "?" in the rel_path part) to perform operations with
> significant side effects, caches MUST NOT treat responses to such
> URIs as fresh unless the server provides an explicit expiration time.

Then it should actually be max-age that's set to 0 since the aim is to
avoid treating an object without an explicit expiry time as fresh.

So it seems that an alternate way of handling query urls would be to
remove the cache statements and use something like this at the
beginning of the refresh rules:

refresh_pattern -i ://([^/]*\.)?(youtube|video.google)\. 1000 20% 9999
refresh_pattern -i cgi-bin|\? 0 0% 0
Received on Wed Aug 15 2007 - 07:11:37 MDT

This archive was generated by hypermail pre-2.1.9 : Sat Sep 01 2007 - 12:00:03 MDT