Long ago (long before the first post in this blog!) I’ve composed a list of cache-related HTTP headers, so I would not need to go through the trial-and-error process of guessing the right combination more than once. Recently I got another question about caching and it took me a lot of time to recall where I saw this list last time. So now I’m placing it here.
Caching in HTTP 1.1
Following directive does not prevent caching despite its name. It allows caching of the page, but specifies that the cache must ask the originating web server if the page is up-to-date before serving the cached version. So the cached page can still be served up if the originating web server says so. Applies to all caches.
Following directive tells the browser that the page has expired and must be treated as stale. Should be good news as long as the caches obey.
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Following directive specifies that the page contains information intended for a single user only and must not be cached by a shared cache (e.g. a proxy server).
Following directive specifies that a cache must not store any part of the response or the request that elicited it.
Following directive tells the cache that the maximum acceptable staleness of a page is 0 seconds.
Caching in HTTP 1.0
Following directive is the only cache control directive for HTTP 1.0, so use it in addition to any HTTP 1.1 cache control headers you include.