Overview#

Cache-Control is an HTTP Header Field general-header field is used to specify directives that MUST be obeyed by all HTTP caching mechanisms along the request/response chain.

Caching mechanisms would include browsers, user-agents, WEB Agents WAM, Proxy-Based WAM and Proxy Servers

The directives are case-insensitive and have an optional argument, that can use both token and quoted-string syntax. Multiple directives are comma-separated.

Cache-Control request directives#

Standard Cache-Control directives that can be used by the client in an HTTP Request.
  • Cache-Control: max-age=<seconds>
  • Cache-Control: max-stale[=<seconds>]
  • Cache-Control: min-fresh=<seconds>
  • Cache-control: no-cache - Forces caches to submit the request to the origin server for validation before releasing a cached copy.
  • Cache-control: no-store
  • Cache-control: no-transform
  • Cache-control: only-if-cached - Indicates to not retrieve new data. The client only wishes to obtain a cached response, and should not contact the origin-server to see if a newer copy exists.

Cache-Control response directives#

Standard Cache-Control directives that can be used by the server in an HTTP Response
  • Cache-control: must-revalidate - The cache must verify the status of the stale resources before using it and expired ones should not be used.
  • Cache-control: no-cache - Forces caches to submit the request to the origin server for validation before releasing a cached copy.
  • Cache-control: no-store - Indicates to not retrieve new data. The client only wishes to obtain a cached response, and should not contact the origin-server to see if a newer copy exists.
  • Cache-control: no-transform
  • Cache-control: public - Indicates that the HTTP Response may be cached by any cache.
  • Cache-control: private - Indicates that the response is intended for a single user and must not be stored by a shared cache. A private cache may store the response.
  • Cache-control: proxy-revalidate
  • Cache-Control: max-age=<seconds>
  • Cache-control: s-maxage=<seconds>

Extension Cache-Control directives#

Extension Cache-Control directives are not part of the core HTTP caching standards document. Be sure to check the compatibility table for their support.
  • Cache-control: immutable
  • Cache-control: stale-while-revalidate=<seconds>
  • Cache-control: stale-if-error=<seconds>

More Information#

There might be more information for this subject on one of the following:

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-7) was last changed on 08-Mar-2017 11:06 by jim