Neil Turner's Blog

Blogging about technology and randomness since 2002

Making images expire

Jeremy Zawodny has a quick guide to set expiry dates for images under Apache. It means that most browsers will know not to refresh any images on your site for a set amount of time (a month in Jeremy’s example). It should therefore help improve performance and reduce bandwidth usage on sites, especially those with big images which do not change frequently.

And yes, I have just added this to this site at one o’clock in the morning, while under the influence of alcohol, so if you see anything bizarre happening on the site this may be why. However, everything seems to be working fine.

And for the record, where I’m living in Bradford, we’re not flooded and have full electric and water supplies, though my thoughts are with those less fortunate right now.

One Comment

  1. I keep meaning to do this myself, although we now run lighttpd rather than Apache so it’ll be a different method and I think will require another module (meaning more memory usage). Given my bandwidth usage is well within limits, it therefore seems a little wrong to add caching.
    I have been playing around with a reverse proxy cache recently, mostly because I can rather than because I actually need it though. But using that proxy cache to ssl-enable the admin interfaces on my server would be rather cool.
    And my thoughts are for people who have just set off towards the floods carrying a tent…