Proposed refresh algorithm changes

From: Duane Wessels <wessels@dont-contact.us>
Date: Mon, 20 Jul 1998 16:34:28 -0600

setting entry->lastmod equal to entry->timestamps has caused a few
problems. I'm suggesting to change the code and algorithm as follows:

        if the response does not include a Last-Modified reply
        header, then entry->lastmod = -1.

        We will NOT make IMS validations for entries with
        ->lastmod == -1.

        Instead the 'refresh_pattern' MIN parameter will be moved
        to the end of the refreshCheck() algorithm and it will apply
        to cache hits which lack ->lastmod. Thus, the MIN parameter
        no longer ALWAYS violates HTTP, but only comes into effect
        when there is no Expires: and no Last-Modified: reply header.

The new algorithm would be:

==============================================================================

Is the cached object stale?

1) client request Max-Age
        if (request->max_age)
                if (AGE > request->max_age)
                        return 1;

2) server response Expires
        if (reply->expires)
                if (reply->expires <= NOW)
                    return 1;
                else
                    return 0;

3) squid.conf max-age
        if (AGE > conf->max_age)
                return 1;

4) server response Last-Modified
    if (reply->last_modified && if (entry->last_valid > reply->last_modified)
        factor = age / (entry->last_valid - reply->last_modified)
        if (factor < conf->factor)
            return 0;
        else
            return 1;
    
5) squid.conf min-age
    if (AGE < conf->min_age)
        return 0;

6) default:
        return 1;
Received on Tue Jul 29 2003 - 13:15:51 MDT

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