Re: [squid-users] Object becomes STALE: refresh_pattern min and max

From: Michael Alger <squid_at_mm.quex.org>
Date: Wed, 24 Sep 2008 19:49:38 +0800

On Wed, Sep 24, 2008 at 03:39:16AM -0700, BUI18 wrote:
> I have squid box with tons of disk for the cache_dir
> (hundreds of GB). I use wget to perform some pre-fetching of large
> video files. I've set the min and max age to 5 days and 7 days (in
> minutes). And although I have plenty of disk space available, I still
> receive TCP_REFRESH_MISS for files that had been pre-fetched and later
> accessed the same day. Does anyone know why Squid would consider it as
> STALE? I thought that by setting the min value for refresh_pattern for
> the video file would guarantee freshness. Not only does the cache
> consider it STALE, it then goes and pre-fetches a new copy even though
> I know that the video file has not changed. Any help would be greatly
> appreciated. Thanks.

The fact that it's doing TCP_REFRESH_xxx means squid does have a
cached copy which it considers potentially stale. So it's sending an
If-Modified-Since request to the origin server. The origin is then
either saying "yes, it's been modified since you retrieved it --
here's a new one"; or it has no idea how to handle IMS and is
sending the whole object regardless.

What Expires: header is the server sending? You can use the -S
switch with wget to show the server response headers when you're
doing your pre-fetch. If they look fine, maybe keep a copy of them
and compare later in the day when squid decides it needs a new one.

I assume you're setting the min and max age via refresh_pattern
lines? Remember that these are only used in the absence of an
Expires header.
Received on Wed Sep 24 2008 - 11:49:43 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 24 2008 - 12:00:03 MDT