Cache-Control explainer

Explain a Cache-Control header directive by directive and how browsers and CDNs will treat the response.

Input

The Cache-Control header value (with or without the header name).

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/cache-control-explain \
  -H 'Content-Type: application/json' \
  -d '{"input":{"value":"public, max-age=3600, s-maxage=86400"}}'
import json, urllib.request

body = {'input': {'value': 'public, max-age=3600, s-maxage=86400'}}
request = urllib.request.Request("https://setget.net/v1/tools/cache-control-explain", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/cache-control-explain", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"value":"public, max-age=3600, s-maxage=86400"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "cache-control-explain",
  "input": {
    "value": "public, max-age=3600, s-maxage=86400"
  }
}
{
  "input": {
    "value": "public, max-age=3600, s-maxage=86400"
  }
}

Endpoint: POST /v1/tools/cache-control-explain. Over MCP: run_tool with slug: "cache-control-explain". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
value string yes The Cache-Control header value (with or without the header name).

Examples

Input
{
  "value": "public, max-age=3600, s-maxage=86400"
}
Result
{
  "directives": [
    {
      "name": "public",
      "value": null,
      "meaning": "Any cache may store the response, even one that would normally be treated as private."
    },
    {
      "name": "max-age",
      "value": 3600,
      "meaning": "The response is fresh for 1 hour. Caches may reuse it without asking the server during that time."
    },
    {
      "name": "s-maxage",
      "value": 86400,
      "meaning": "Shared caches such as CDNs and proxies may reuse it for 1 day. For them this replaces max-age."
    }
  ],
  "summary": "Browsers may reuse it for 1 hour without contacting the server; shared caches such as CDNs may reuse it for 1 day.",
  "warnings": []
}

Conflicting directives

Input
{
  "value": "Cache-Control: no-store, max-age=60"
}
Result
{
  "directives": [
    {
      "name": "no-store",
      "value": null,
      "meaning": "No cache may store the response at all."
    },
    {
      "name": "max-age",
      "value": 60,
      "meaning": "The response is fresh for 1 minute. Caches may reuse it without asking the server during that time."
    }
  ],
  "summary": "Nothing may store this response: browsers and shared caches fetch it from the server every time.",
  "warnings": [
    "no-store wins over the other directives, so max-age and public have no effect."
  ]
}

Questions

Does no-cache mean "do not cache"?
No. It means "store it, but check with the server before using it". To forbid storing, use no-store.
What is a shared cache?
A cache that serves many people, such as a CDN or a company proxy, as opposed to the private cache in one browser.