Re: Patch: Overriding no-cache from servers

From: David S. Madole <david@dont-contact.us>
Date: Sat, 11 Sep 1999 15:08:11 -0400

The patch referenced in the following was slightly defective and has
been fixed. If you happened to download it, you should get it again,
or change the following in http.c:

    const refresh_t *R = refreshLimits(httpState->entry->mem_obj->url);
    if (R && R->flags.ignore_no_cache) return 1;
    else return 0;
    }
to

    const refresh_t *R = refreshLimits(httpState->entry->mem_obj->url);
    if (R && !R->flags.ignore_no_cache) return 0;
    }

Sorry - it was late at night when I made it. I'm looking at improving
it by using the call to refreshIsCachable that's already in http.c,
but I haven't figured out all of the implications and cases yet.

-----

I sent the following message earlier, and have since implemented a
solution. I have added a "ignore-no-cache" option to the refresh-pattern
configuration. I am currently using the following line for the problem
URLs mentioned below and a few others to force them to cache for 30
minutes:

   refresh_pattern /RealMedia/ads/ 30 20% 4320 ignore-no-cache

The patch is against Squid 2.2.STABLE4 and is located at:

   http://www.omdev.com/squid/squid-2.2.STABLE4.ignore-no-cache.patch

It's fairly simple, but I'd appreciate any comments, as this is my
first attempt at modifying Squid.

Dave

> I see by looking at the code that objects with a "Pragma: no-cache" tag
> are made unconditionally non-cacheable, even though that's not a valid
> header coming from a server. I would like to be able to override this,
> has anybody looked at good ways to do it? I almost pulled it right
> out, since it shouldn't been happening anyway, but I got rational and
> didn't.
>
> Specifically, I get 70,000+ TCP_MISSes on 6-7K objects from weather.com
> every day, and none of them ever change, but they all com tagged with
> "no-cache". I wouldn't mind saving the 50 megabytes/day by assigning
> these requests some kind of refresh rule instead. I don't necessarily
> mind doing the code myself, but am looking for ideas on how to do it
> cleanly.
Received on Sat Sep 11 1999 - 13:17:25 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:48:24 MST