Re: [squid-users] refresh_pattern and forcing "gifs" to be cached

From: Donovan Baarda <abo@dont-contact.us>
Date: Thu, 15 Aug 2002 00:39:30 +1000

On Wed, Aug 14, 2002 at 03:09:03PM +0100, Joao Clemente wrote:
> > What if these are spacer graphics, used by web designers to control site
> > layout, and therefore served with no-cache tags? Just a thought.
>
> Well, I looked up the URL by following Donovan Baarda tip (thank you Donovan) of using wget -S and this was what I've found:
>
>
>
> jpcl@Beach:~$ wget -S http://www.negocios.pt/imagens/noticias/belmiro_de_azevedo_01.gif
> --14:26:02-- http://www.negocios.pt/imagens/noticias/belmiro_de_azevedo_01.gif
> => `belmiro_de_azevedo_01.gif'
> Resolving www.negocios.pt... done.
> Connecting to www.negocios.pt[212.55.136.42]:80... connected.
> HTTP request sent, awaiting response...
> 1 HTTP/1.1 200 OK
> 2 Server: Microsoft-IIS/5.0
> 3 Cache-Control: no-cache
> 4 Expires: Wed, 14 Aug 2002 13:33:33 GMT
> 5 Connection: keep-alive
> 6 Date: Wed, 14 Aug 2002 13:33:33 GMT
> 7 Content-Type: image/gif
> 8 Accept-Ranges: bytes
> 9 Last-Modified: Thu, 08 Jul 1999 16:23:04 GMT
> 10 ETag: "0a483275ec9be1:95c"
> 11 Content-Length: 7882
>
>
> This is not a spacer graphic, its a image that comes with a news article. I've checked the page log and it exibits the same Cache-Control , and reports a expire date equal to the actual date, just like this one.
> I think that this must be a bad web design or maybe a bad server config...
> As U can see, the Last-Modified date reports to 1999, so why shouldn't this image be cached?

bastards... guys like this _deserve_ overide-expire, reload-into-ims, and
ignore-reload.

These are options on the refresh_pattern to force ignoring some stuff that
violates the HTTP standard. Sites like this might not be violating the
standard, but they are violating its spirit and deserver a bit of violence
back :-)

>
> I think I'll have a problem here tough.. If I understood correctly, refresh_pattern can only give a min freshness time if the object does not have the "no-cache" explicitily.. and all the images on this site do have it.

ignore-reload will ignore client no-cache headers, override-expire will
ignore a server expires headers. I dunno if "ignore-reload" will ignore a
server "no-cache" header, but I hope so. If not, perhaps override-expire
will do the job.

> But, for instance, check this other example:
> jpcl@Beach:~$ wget -S http://webmail.dad.be/exchange/forms/nextmsg.gif
> --14:57:15-- http://webmail.dad.be/exchange/forms/nextmsg.gif
> => `nextmsg.gif.1'
> Resolving webmail.dad.be... done.
> Connecting to webmail.dad.be[194.78.137.30]:80... connected.
> HTTP request sent, awaiting response...
> 1 HTTP/1.1 200 OK
> 2 Server: Microsoft-IIS/4.0
> 3 Connection: keep-alive
> 4 Date: Wed, 14 Aug 2002 14:03:07 GMT
> 5 Content-Type: image/gif
> 6 Accept-Ranges: bytes
> 7 Last-Modified: Thu, 19 Oct 2000 05:00:00 GMT
> 8 ETag: "048e26e8939c01:f5f"
> 9 Content-Length: 91
>
>
> This one also does not get cached. And it does not get cached because it does not have and Expires header, I think.
> Once again, this one has Last-Modified date from so long that it could be cached.

This one should be cached... even without an expires header, squid should be
using it's lm-factor test for freshness. even with a percent of only 50%
this object should be considered "fresh" for another year. You don't have
the % set to 0% do you?

-- 
----------------------------------------------------------------------
ABO: finger abo@minkirri.apana.org.au for more info, including pgp key
----------------------------------------------------------------------
Received on Wed Aug 14 2002 - 08:39:47 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:09:37 MST