Re: [squid-users] Caching Expired Objects

From: Adrian Chadd <adrian@dont-contact.us>
Date: Tue, 18 Sep 2007 17:28:37 +0800

On Tue, Sep 18, 2007, Solomon Asare wrote:
> Hi Henrik,
> thanks for your insightful response. However, the
> object is a .flv file that hasn't changed in months.
> The origin server certainly doesn't want the object
> cached, but I want to. Any leads that can help me
> achieve this?

* set your refresh_pattern's right, you can override almost all the relevant
  headers in there;
* if the URL has a ? in it then you need to look at the cache/no_cache directives
* if in doubt, compile with the option to log request/reply headers (I forget
  what it is, ./configure --help will tell you) and take a look at exactly what
  headers they're sending back.

Adrian

> Regards,
> solomon.
>
> --- Henrik Nordstrom <henrik@henriknordstrom.net>
> wrote:
>
> > On m?n, 2007-09-17 at 11:55 -0700, Solomon Asare
> > wrote:
> > > Hi Amos,
> > > I am not sure if refresh_pattern is the sole
> > > determinant in caching an object, that is if it
> > has
> > > any influence at all.
> >
> > It has influence, both directly by assigning
> > freshness information when
> > there is none, and indirectly by overriding various
> > HTTP controls..
> >
> > Requirementsto cache stale objects:
> >
> > a) The object must have a cache validator
> > (Last-Modified or ETag). If
> > there is no cache validator then the response must
> > be fresh for at least
> > minimum_expiry_time to get cached, this to avoid
> > wasting disk I/O for
> > caching content which can not be reused.
> >
> > b) There must not be other headers preventing it
> > from getting cached.
> > refresh_pattern can override most of these if
> > needed.
> >
> > > I am not discussing getting a
> > > HIT for a cached object, but rather caching an
> > expired
> > > object from an origin server. If this object is
> > > expired, by say 60 seconds before being served
> > from
> > > the origin server, how do I cache it? Date and
> > > Last-Modified dates are also not set.
> >
> > If there is no Last-Modified and no ETag then it's
> > useless to cache an
> > expired object, as it can not be reused on any
> > future request and all
> > you get is extra disk I/O for writing the object
> > out.
> >
> > A cache validator (Last-Modified or ETag) is
> > required to be able to
> > verify with the origin server if an expired object
> > is still valid or
> > not. Without a cache validator there is nothing to
> > relate to and there
> > is no other choice than to fetch the complete object
> > again when
> > expired..
> >
> > Regards
> > Henrik
> >

-- 
- Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support -
- $25/pm entry-level bandwidth-capped VPSes available in WA -
Received on Tue Sep 18 2007 - 03:24:06 MDT

This archive was generated by hypermail pre-2.1.9 : Mon Oct 01 2007 - 12:00:02 MDT