HTTP headers used for browser caching. The following is generally a good one to use for a balance of fresh files + cache efficiency.
Cache-Control: public, max-age=0, s-maxage=60, must-revalidate
- The response can be cached by both a shared proxy and the browser.
- The response should not be cached by a shared proxy, only by the browser.
- The number of seconds a proxy or browser should cache the response, before being considered stale.
- The number of seconds a shared cache (proxy) should cache the response, before being considered stale.
- The browser or proxy will re-request the file whilst also sending a hash of the current file it has (via the request header
If-None-Match=<etag provided with the initial file repsonse>). The server or proxy will compare the hash with its current file and send back either a
304 Not Modifiedheader response, or a
200 Okresponse with the contents of the updated file.