Re: Whay are code 340 pages not cahced? and how do I force them to be?

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 11 Feb 2000 05:18:23 +0100

Stan Brown wrote:
>
> On Thu Feb 10 16:59:40 2000 Henrik Nordstrom wrote...
> >
> >Stan Brown wrote:
> >
> >Squid tries to cache all responses carrying an object, except where
> >explicitly forbidden by HTTP specifications.
>
> OK, heres an good example site: http://www.ab.com/
>
> Virtualy nothing from that site winds up in my cache. Any idea why?

http://www.ab.com/ reports the HTTP headers
---------------
HTTP/1.0 200 OK
Server: Netscape-Enterprise/3.6 SP1
Date: Fri, 11 Feb 2000 03:58:30 GMT
Content-type: text/html
---------------

This reply does not carry any information giving a hint to Squid how
long it may be cached;
* There is no Last-Modified timestamp
* There is no Expires header setting a explicit expiry time
* There is no Cache-Control header telling Squid it may be cached

On such replies the default configuration considers the reply dynamic
and uncacheable.

> >Not available. The information was not provided by the origin server.
>
> OL, that does not prevent it from being a chaeable page, or does it?

Unless some information (either Last-Modifies, expires or one of the
Cache-Control options related to how long a object may be cached) is
available it will, by the assumption that such replies are dynamically
generated.

Most references images should be cached fine however.

For example http://www.ab.com/images/template/ablogo4home.gif returns

------------------------------
HTTP/1.0 200 OK
Server: Netscape-Enterprise/3.6 SP1
Date: Fri, 11 Feb 2000 04:06:37 GMT
Content-type: image/gif
Last-modified: Tue, 12 Oct 1999 13:58:41 GMT
Content-length: 1242
Accept-ranges: bytes
------------------------------

Which includes a Last-Modified header, allowing squid to use heuristics
based on this to determine how long the object can be considered fresh,
and requery the server when it isn't to check if the object has been
updated.

You can tell Squid to cache dynamically generated content which isn't
explicitly forbidden to be cached by tuning your refresh_pattern to have
a min age other than 0. The default meaning of the min age in
refresh_pattern is to act as a default TTL if no expiry/modification
information is available. However, keep in mind that this may cause some
content to be cached which aren't meant to be cached. Also, replies
without a Last-Modified timestamp cannot be revalidated by the origin
server, and will thus be fetched in whole if the ttl has expired.

Most of this can be diagnosed from the store.log. The important colums
are the LMT and Expires columns. If both of these are -1 then Squid has
nothing to go on.

--
Henrik Nordstrom
Squid hacker
Received on Thu Feb 10 2000 - 22:38:18 MST

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