httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject Re: [users@httpd] Image caching / Expiry times / 304s
Date Tue, 06 Jun 2006 13:30:47 GMT
On 6/6/06, Matthew Claridge <mclaridge@rwa-net.co.uk> wrote:
> Hi all,
>
> I'm not sure if this is possible, because to me sending 304s is just
> "how it all works"!.......however, my boss is looking for ways to
> prevent a browser continually requesting images from our apache server -
> these requests inevitably receive a 304 response and the thinking behind
> this is that this is just a waste of resources on an already very busy
> server.
>
> We've looked into mod_expiry, but this doesn't really work, because as
> soon as the expiry time is reached the browser starts requesting it
> again and a new expiry is never set until the server actually sends the
> image, so we can make this work with huge expiry times, but thats just
> not practical as it means the images are never requested even if we've
> changed them.

Two issues here:

1. The server should indeed be updating the Expires and Cache-Control
headers even on 304 responses.  See RFC2616 section 10.3.5.  If it is
not doing that, it is a bug.  (It may also be a bug in the client that
ignores the updated Cache-Control.)

2. A good practice is to set very-long expire (Cache-Control: max-age)
headers on your images and then *never* change them.  If you need to
update the content, use a different filename.  Of course, I believe
most browsers and caches tend to ignore expiry dates more than a day
or so in the future anyway.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message