Re: Patch: Overriding no-cache from servers

From: Thilo Manske <Thilo.Manske@dont-contact.us>
Date: Wed, 15 Sep 1999 17:56:45 +0200

On Sat, Sep 11, 1999 at 02:40:21AM -0400, David S. Madole wrote:
> 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
Works great. But not great enough for me:-)

I've expanded your modifications a little bit, so that it overrides
"Cache-Control: no-cache" as well.

I'm no C-coder, so I've just copied a snippet of what you did to another place...

--- src/http.old Mon Sep 13 14:21:57 1999
+++ src/http.c Wed Sep 15 17:33:01 1999
@@ -181,8 +181,10 @@
     const char *v;
     if (EBIT_TEST(cc_mask, CC_PRIVATE))
        return 0;
- if (EBIT_TEST(cc_mask, CC_NO_CACHE))
- return 0;
+ if (EBIT_TEST(cc_mask, CC_NO_CACHE)) {
+ const refresh_t *R = refreshLimits(httpState->entry->mem_obj->url);
+ if (R && !R->flags.ignore_no_cache) return 0;
+ }
     if (EBIT_TEST(cc_mask, CC_NO_STORE))
        return 0;
     if (httpState->request->flags.auth) {

(No, I don't make use of it on a "production" server, but there's this
site that annoys me with its dead-slow "counter gifs" on every page.)

-- 
Dies ist Thilos Unix Signature! Viel Spass damit.
Received on Wed Sep 15 1999 - 10:12:37 MDT

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