PDA

View Full Version : Fixing HTTP cache management



Jason Holtzapple
2004-02-17, 11:57
--- "Talley, Brooks" <brooks (AT) frnk (DOT) com> wrote:
>...
> However, there's a fairly glaring problem in the way the web interface
> handles browser cache management. You can see the problem with each
> refresh of the web interface -- on both Firefox and IE 6, at least,
> every .gif image is actually downloaded over and over again with each
> refresh of the page. It's only a couple of K, total, but it is a lot of
> TCP connections, and most browsers will only download a few images at
> once, so the downloads are largely serialized and cause the interface to
> redraw slowly.
>
> The problem stems from a badly formatted Expires: HTTP header, and the
> lack of a cache-control header. Right now, a typical HTTP header for a
> .gif file is:
>
> HTTP/1.0 200 OK
> Connection: close
> Content-Length: 150
> Content-Type: image/gif
> Expires: Wed Feb 16 18:33:55 2005

The images in Mozilla 1.6 have the proper expire time and are cached.
I don't think Cache-Control is a standard part of HTTP/1.0

There are two places in HTTP.pm where an Expires header is created.
One is correct and one is wrong - I'll submit a patch to the developers
to fix the incorrect one.

--Jason

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html