HTTP Cache-Control Directives
Every Cache-Control directive defined in RFC 9111 (the current HTTP caching standard) plus the widely-adopted stale-while-revalidate and stale-if-error extensions from RFC 5861, and the immutable extension. Each entry records the directive name, whether it applies to requests, responses, or both, and a precise description of its semantics.
Quick fetch
Stable URL. CORS-enabled. No auth.
curl https://staticdata.dev/v1/http-cache-directives.json
Or use as a typed import:
import { httpCacheDirectives } from "https://staticdata.dev/v1/http-cache-directives.ts"
Formats
- JSON 3.6 KB
/v1/http-cache-directives.json
min: 3.3 KB · /v1/http-cache-directives.min.json
- CSV 2.7 KB
/v1/http-cache-directives.csv
- TypeScript 3.9 KB
/v1/http-cache-directives.ts
export const httpCacheDirectives
type CacheDirective = (typeof httpCacheDirectives)[number]
Schema
Each record in the dataset has the following shape.
| Field | Type | Description | Example |
|---|---|---|---|
| directive | string | The Cache-Control directive token | max-age |
| type | string | Applicable context: request, response, or both | response |
| description | string | Precise description of the directive's semantics | Specifies the maximum time in seconds that a response is considered fresh. |
Preview
First 10 records.
| directive | type | description |
|---|---|---|
| max-age | both | Specifies the maximum time in seconds that a response is considered fresh. In a request, it limits the age of an acceptable cached response. |
| max-stale | request | Indicates the client is willing to accept a stale response, optionally limited to a maximum staleness in seconds. |
| min-fresh | request | Indicates the client is willing to accept a response whose freshness lifetime is at least the specified number of seconds in the future. |
| must-revalidate | response | Indicates that the response must not be used after it becomes stale. Caches must revalidate with the origin server before serving a stale response. |
| must-understand | response | A cache should only store the response if it understands the requirements for caching based on the status code. Introduced in RFC 9111. |
| no-cache | both | In a response, requires the cache to revalidate with the origin server before serving the stored response. In a request, forces a revalidation regardless of freshness. |
| no-store | both | Directs caches not to store any part of the request or response. The response must not be stored in any cache. |
| no-transform | both | Instructs intermediaries not to transform the payload, such as compressing images or converting formats. |
| only-if-cached | request | Indicates that the client only wishes to obtain a stored response. If no suitable response is in cache, the cache should respond with 504 Gateway Timeout. |
| private | response | Indicates that the response is intended for a single user and must not be stored by shared caches. Private (browser) caches may store the response. |
Fetch examples
Drop-in snippets in five languages.
curl -sSL https://staticdata.dev/v1/http-cache-directives.json | jq '.[0]' import type { CacheDirective } from "https://staticdata.dev/v1/http-cache-directives.ts";
const res = await fetch("https://staticdata.dev/v1/http-cache-directives.min.json");
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
const httpCacheDirectives: CacheDirective[] = await res.json();
console.log(httpCacheDirectives[0]); import urllib.request, json
with urllib.request.urlopen("https://staticdata.dev/v1/http-cache-directives.min.json") as r:
httpCacheDirectives = json.load(r)
print(httpCacheDirectives[0]) package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
resp, err := http.Get("https://staticdata.dev/v1/http-cache-directives.min.json")
if err != nil { panic(err) }
defer resp.Body.Close()
var data []map[string]any
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
panic(err)
}
fmt.Println(data[0])
} use serde_json::Value;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let body = ureq::get("https://staticdata.dev/v1/http-cache-directives.min.json").call()?.into_string()?;
let data: Vec<Value> = serde_json::from_str(&body)?;
println!("{:?}", data.first());
Ok(())
} Sources and methodology
The directives in this dataset are curated from RFC 9111, the current HTTP caching specification that obsoletes RFC 7234. RFC 9111 defines the core request and response Cache-Control directives that govern how caches store, serve, and revalidate HTTP responses. The stale-while-revalidate and stale-if-error directives are sourced from RFC 5861, and immutable follows the widely-implemented extension described in RFC 8246.
Each record identifies the directive name (the bare token used in a Cache-Control header field), its applicable context — request (sent by clients), response (sent by servers), or both — and a concise description of its caching semantics. Directives that accept an argument (such as max-age=<seconds> or stale-while-revalidate=<seconds>) are documented at the directive level; argument validation is left to the consuming application.
This dataset covers all 16 directives in the IANA HTTP Cache Directive Registry as of October 2026. Proprietary or vendor-specific extensions (e.g., pre-check, post-check) are intentionally excluded as they are non-standard.
Versioning
URLs under /v1/ are stable: field names and types will not change in a way
that breaks consumers. Values can be corrected or records added when the upstream source
changes; schema-incompatible updates ship under a new version path. See the
http-cache-directives changelog for this dataset's history.
More Web datasets
- aria-attributes
- aria-roles
- character-encodings
- csp-directives
- credit-card-types
- dns-record-types
- dom-events
- emoji
- emoji-shortcodes
- html-elements
- html-entities
- html-attributes
- input-types
- http-auth-schemes
- http-content-codings
- http-headers
- http-methods
- http-status-codes
- http-versions
- iframe-sandbox-tokens
- ip-protocol-numbers
- keyboard-event-codes
- link-relations
- media-type-suffixes
- mime-types
- oauth-grant-types
- ports
- referrer-policies
- ip-special-blocks
- svg-elements
- tcp-flags
- tlds
- tls-cipher-suites
- tls-versions
- uri-schemes
- well-known-uris