# Cache-Control explainer

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

- Endpoint: `POST https://setget.net/v1/tools/cache-control-explain` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `cache-control-explain`
- Page: https://setget.net/tools/cache-control-explain

## Inputs

- `value` (required, string): The Cache-Control header value (with or without the header name).

## Example 1

```json
{"input":{"value":"public, max-age=3600, s-maxage=86400"}}
```

Result:

```json
{"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":[]}
```

## Example 2: Conflicting directives

```json
{"input":{"value":"Cache-Control: no-store, max-age=60"}}
```

Result:

```json
{"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."]}
```

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