Re: please help: refresh_pattern question

From: Dancer <dancer@dont-contact.us>
Date: Sun, 08 Feb 1998 23:54:45 +1000

RL wrote:

> Hello,
>
> I am new to squid, and am using it as a local http accellerator.
>
> I have a site which changes frequently, and I want to make sure that squid
> checks to see if pages have changed on a regular basis.
>
> What refresh_pattern would I use to have squid check every 60 minutes to see
> if an object has been updated? What I want is for it to check each object
> every 60 minutes (if there is a request), but not check again for another 60
> minutes.
>
> I'm unclear about how the parameters of refresh_pattern work. We have:
>
> refresh_pattern regex min percent max
>
> I understand that min refers to the minimum age something has to be before
> it is checked. But is that minimum time since the LAST check, or minimum
> time since the last-modified date on the file?

min refers to the minimum amount of time for the object to be marked as 'fresh'.
When it is no longer 'fresh' it will be checked again when someone requests it.
Therefore, if you set min to 60, the site will get checked no more often than
every hour.

> Likewise, does max refer to time since last check or time since
> last-modified date on the file?

Max means the maximum time for an object to be regarded as fresh.

Squid takes the difference between the time 'now' and the time the document was
last changed (using the last-modified header), and applies the percentage. (if
it last changed 8 hours ago, and you set 50%, then it would figure it to be four
hours). That time is then increased to at least 'min', and decreased to at most
'max'. (ie: if it is greater than max, it gets reduced to max, if it is less
than min, it is reduced to min). Squid then stores that as the amount of time
from 'now' that the object will remain fresh in the cache. It will not be
checked again until stops being 'fresh' (becomes 'stale').

> Also, regarding the regex. I assume it refers to a regex describing the
> objects? So what would work for all objects, the default of:
> .
>
> Or would one use :
> .*
>
> ? Are paths permitted, such as:
> /mydir.*
>
> (which I would hope would control everything in the /mydir tree)?

Refresh patterns work on the entire URL. So you can match 'http' or
'www.somewhere.com' or whatever.

I think what would serve you best is:

refresh_pattern/i WHATEVER 60 100% 60

(Keep for exactly one hour. WHATEVER is your pattern, which I guess could be the
entire URL, if you want).

D

--
Did you read the documentation AND the FAQ?
If not, I'll probably still answer your question, but my patience will
be limited, and you take the risk of sarcasm and ridicule.
Received on Sun Feb 08 1998 - 06:00:45 MST

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