HTTP headers notes

27th June, 2013

Caching

Cache-Control

The Cache-Control header defines two things.

  1. whether the resource is public or private, i.e. if it should be cached by any proxy, or by only the ultimate reciever.
  2. max-age: how long to cache the resource in seconds

e.g. Cache-Control:public, max-age=86400

max-age can be left out if you instead include an Expires header.

Expires

Expires optionally accompanies Cache-Control, setting a date after which browsers should re-fetch the resouce.

e.g. Expires: Mon, 25 Jun 2012 21:31:12 GMT

If a Cache-Control max-age is specified, it overrides Expires.

Reference

devcenter.heroku.com

References

wikipedia