Hi all

Bit of a (deepish) code question here...

In the refreshCheck function in refresh.cc (squid3 head revision):


        if (!request->flags.nocache_hack) {
            (void) 0;
        } else if (R->flags.ignore_reload) {
            /* The clients no-cache header is ignored */
            debug(22, 3) ("refreshCheck: MAYBE: ignore-reload\n");
} else if (R->flags.reload_into_ims || Config.onoff.reload_into_ims) { /* The clients no-cache header is changed into a IMS query */
            debug(22, 3) ("refreshCheck: YES: reload-into-ims\n");
            return STALE_RELOAD_INTO_IMS;
        } else {
/* The clients no-cache header is not overridden on this request */
            debug(22, 3) ("refreshCheck: YES: client reload\n");
            request->flags.nocache = 1;
            return STALE_FORCED_RELOAD;
        }

I've dug in the code and interpreted the if statement as follows: If there are no occurrences of reload-into-ims or ignore-reload in any refresh_patterns, and reload_into_ims is off, then flags.nocache_hack will be false.

But doesn't this code mean that if I've got a reload-into-ims or ignore-reload in at least one of my refresh_patterns, but the request currently being analysed by this method does NOT have either of these flags, (i.e. skips the first two else statements) that it will always be force-reloaded?

If so, is this intentional?
And why does the final comment imply a 'no-cache' header was present in the request? I can't see why that's true

Thanks for any help
Doug

Reply via email to