Asking browsers to cache as aggressively as possible
Posted
by balpha
on Stack Overflow
See other posts from Stack Overflow
or by balpha
Published on 2010-03-11T15:16:44Z
Indexed on
2010/03/13
18:15 UTC
Read the original article
Hit count: 209
This is about a web app that serves images. Since the same request will always return the same image, I want the accessing browsers to cache the images as aggressively as possible. I pretty much want to tell the browser
Here's your image. Go ahead and keep it; it's really not going to change for the next couple of days. No need to come back. Really. I promise.
I do, so far, set
Cache-Control: public, max-age=86400 Last-Modified: (some time ago) Expires: (two days from now)
and of course return a 304 not modified
if the request has the appropriate If-Modified-Since
header.
Is there anything else I can do (or anything I should do differently) to get my message across to the browsers?
The app is hosted on the Google App Engine, in case that matters.
© Stack Overflow or respective owner