[squid-users] Re: no_cache

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 25 Mar 2002 20:14:56 +0100

Actually I think the feature of blocking already cached content from
caching has since then been implemented in Squid-2.5, so an upgrade
should take care of it, but imho no_cache is not the correct solution to
your problem.

We won't fix this in Squid-2.4 as it it is by design and not a bug, and
is how it is documented to work in Squid-2.4.

If you search on squid-users you will find a number of approaches how to
address already cached items when changing the no_cache policy.

A) PURGE the offending objets if you know them

B) Make proper use of refresh_pattern, forcing Squid to revalidate the
objects when requested.

C) If all else fail, clean your cache

As a general rule I recommend correct use of refresh_pattern rather than
trying to patch it up by using no_cache. This way PHP of CGI scripts
written with caching in mind will get properly cached, and dynamic
content not matching your no_cache pattern won't.

PURGE is best used in case of a policy crash due to a malfunctioning
server. The most common cause to a HTTP refgresh polich crash is if a
server sends out replies with an incorrect timestamp, causing a newer
version of the object to have an older timestamp.

To make the story on dynamic content such as PHP short: Do NOT use a
refresh_pattern with a min age other than 0 unless you know exacly what
it will apply to and why.

There is reasons to why the refresh_pattern documentation says:

        'Min' is the time (in minutes) an object without an explicit
        expiry time should be considered fresh. The recommended
        value is 0, any higher values may cause dynamic applications
        to be erroneously cached unless the application designer
        has taken the appropriate actions.

If your refresh_pattern did use 0 as min-age for the objects in question
then I would very much like to know some URL's as there then may well be
a problem somewhere that seriously need to be addressed.

Should also note that the problems seen is also very likely to be seen
by any IE users with or without a proxy cache. The default IE cache
validation setting of "Automatic" is quite aggressive and do cache most
PHP or CGI applications.

Regards
Henrik

Andres Kroonmaa wrote:
>
> Hi Henrik,
>
> I noticed randomly that you closed a complaint with a WONT flag.
> This is real issue and very unpleasant for ppl. Why were you
> so resolute on that matter?
>
> http://www.squid-cache.org/bugs/show_bug.cgi?id=188
>
> I have just noticed that if some objects have been previously cached by the
> squid and I add something to no_cache which match them squid will still
> generate HIT for such objects.
>
> My users reported my that there is a problem with some web pages with php
> scripts. I saw that such pages does not have cgi-bin in document path and "?"
> after script name. I addedd ".php$ php3$ .php4$" to acl QUERY but I did not
> help - I had to remove all objects from my 12GB cache. :( :( :(((
>
> ------- Additional Comments From Henrik Nordstrom 2001-10-08 17:13 -------
>
> This is how it works. no_cache only stops things from being cached.
>
> ------------------------------------
> Andres Kroonmaa <andre@online.ee>
> CTO, Microlink Online
> Tel: 6501 731, Fax: 6501 725
> Pärnu mnt. 158, Tallinn,
> 11317 Estonia
Received on Mon Mar 25 2002 - 12:13:16 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:07:04 MST