staticdata.dev
Menu
Datasets About Contact

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.

v1.0.0 MIT 16 records Updated 2026-10-05 stable Source:  RFC 9111 — HTTP Caching, RFC 5861 — HTTP Cache-Control Extensions for Stale Content

Quick fetch

Stable URL. CORS-enabled. No auth.

bash
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

    Open

    min: 3.3 KB · /v1/http-cache-directives.min.json

  • CSV 2.7 KB

    /v1/http-cache-directives.csv

    Open
  • TypeScript 3.9 KB

    /v1/http-cache-directives.ts

    export const httpCacheDirectives

    type CacheDirective = (typeof httpCacheDirectives)[number]

    Open

Schema

Each record in the dataset has the following shape.

Schema
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.

Data preview
directivetypedescription
max-agebothSpecifies the maximum time in seconds that a response is considered fresh. In a request, it limits the age of an acceptable cached response.
max-stalerequestIndicates the client is willing to accept a stale response, optionally limited to a maximum staleness in seconds.
min-freshrequestIndicates the client is willing to accept a response whose freshness lifetime is at least the specified number of seconds in the future.
must-revalidateresponseIndicates that the response must not be used after it becomes stale. Caches must revalidate with the origin server before serving a stale response.
must-understandresponseA cache should only store the response if it understands the requirements for caching based on the status code. Introduced in RFC 9111.
no-cachebothIn 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-storebothDirects caches not to store any part of the request or response. The response must not be stored in any cache.
no-transformbothInstructs intermediaries not to transform the payload, such as compressing images or converting formats.
only-if-cachedrequestIndicates 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.
privateresponseIndicates that the response is intended for a single user and must not be stored by shared caches. Private (browser) caches may store the response.

Showing 10 of 16. View full data:  JSON · CSV

Fetch examples

Drop-in snippets in five languages.

curl
curl -sSL https://staticdata.dev/v1/http-cache-directives.json | jq '.[0]'
JavaScript
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]);
Python
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])
Go
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])
}
Rust
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