DevKits

Caching · Request & Response

Cache-Control

Directives that control caching behavior.

What is Cache-Control?

Cache-Control is the primary way to instruct browsers and CDN caches how, and how long, a response can be reused. It supersedes older headers like Expires and Pragma.

Typical usage

Set on almost every response. Static assets get long max-age + immutable; HTML gets short max-age or no-store; sensitive responses get no-store.

Examples

Static asset, cache forever

Cache-Control: public, max-age=31536000, immutable

HTML, revalidate every time

Cache-Control: no-cache

Private data, never store

Cache-Control: no-store

CDN caches 1 hour, browsers 1 min

Cache-Control: public, s-maxage=3600, max-age=60

Common gotchas

no-cache does NOT mean 'don't cache' — it means 'cache, but revalidate every time'. Use no-store if you want zero caching. Confusing these two is one of the top HTTP mistakes.

Also known as

Also commonly written as: cache control · cache-control header · cache control header · cache-control max-age · cache-control no-cache · cache-control no-store · cache-control immutable · cache-control s-maxage · http caching header · Cache-Control ヘッダ. These variants — including plural forms, unhyphenated spellings, and Japanese (ヘッダ) — all refer to the same Cache-Control HTTP header.

Specification

RFC 9111

Frequently asked questions

What is the Cache-Control HTTP header?

Cache-Control is the primary way to instruct browsers and CDN caches how, and how long, a response can be reused. It supersedes older headers like Expires and Pragma.

Is Cache-Control a request or response header?

Cache-Control can appear on both requests and responses. Set on almost every response. Static assets get long max-age + immutable; HTML gets short max-age or no-store; sensitive responses get no-store.

What does a Cache-Control header look like?

A typical Cache-Control header looks like: Cache-Control: public, max-age=31536000, immutable (Static asset, cache forever).

What are common mistakes with Cache-Control?

no-cache does NOT mean 'don't cache' — it means 'cache, but revalidate every time'. Use no-store if you want zero caching. Confusing these two is one of the top HTTP mistakes.

Related headers

Work with this header

Read the HTTP Caching Guide →