Cache-Control field
Cache-Control carries case-insensitive directives that constrain caching and reuse.
- caching
- fields
Meaning and syntax
Cache-Control carries a list of case-insensitive directives. Request directives
express client preferences or constraints; response directives describe how
caches may store and reuse that response.
Cache-Control: public, max-age=300, must-revalidate
Expected result: eligible caches can store the response, treat it as fresh for 300 seconds, and must validate it before reuse after it becomes stale. The field does not prove that a particular cache stored it.
Parsing
Recipients must parse the directive list rather than matching a raw string. Extensions can add directives, and repeated or conflicting values need the error handling defined by HTTP caching.
Common mistake
Do not use no-cache when the intent is to prohibit storage. It allows storage
but requires validation before reuse; no-store defines the storage prohibition.
