Cache Control Overview

Analyze cache-related headers across layers. No input is sent to a server. Use it for first-pass revalidation and CDN mismatch troubleshooting.

Status

Runs in your browser. No input is sent to a server. Use this as a first-pass diagnostic step.

How to use

Anchor on Cache-Control and place Pragma/Expires/Age around it.

Roles

  • Cache-Control: primary relative freshness and controls
  • Pragma: legacy for HTTP/1.0 (mainly no-cache)
  • Expires: absolute expiry time
  • Age: seconds stored by intermediaries

Precedence

  • Cache-Control has highest priority
  • Pragma is for legacy compatibility
  • Expires is a fallback when Cache-Control is absent

Common directives

  • no-store: do not store
  • no-cache: revalidate before use
  • max-age=0: immediately stale
  • max-age=31536000, immutable: long cache

Notes (this tool)

  • Older intermediaries or clients may mix Pragma/Expires interpretations.
  • Final behavior is determined by the combination of CDN, browser, and app-side cache implementations.

About this page

What does this page do?

Organize Cache-Control / Pragma / Expires / Age roles and relationships into a practical overview.

Precedence (quick)

  • Cache-Control is usually the primary control
  • Pragma is mainly legacy for HTTP/1.0 compatibility
  • Expires is an absolute expiry (fallback when Cache-Control is absent)
  • Age shows the seconds a response has been cached by intermediaries

Common patterns

  • no-store: do not store at all
  • no-cache + must-revalidate: always revalidate
  • max-age=0: immediately stale (revalidate)
  • max-age=31536000, immutable: long-lived cache

Debugging workflow (recommended)

  • Extract Cache-Control/Expires/Age via Response Headers Parser
  • Use this page to confirm precedence and meaning
  • Inspect details with Cache-Control Inspect / Expires Inspect

Recommendations by use case

  • API (JSON): use no-store for sensitive data; otherwise no-cache + validators
  • HTML: no-cache + must-revalidate or short max-age + validators
  • Static assets: long max-age + immutable + versioned URLs
  • Cache-Control Inspect
  • Pragma Cache Inspect
  • Expires Inspect
  • Age Inspect

What this page covers

  • Summarize Cache-Control / Pragma / Expires / Age relationships
  • Review common practical patterns

Operational notes

  • Cache behavior changes across browser, CDN, and proxy layers, so compare captures from the same observation point.
  • Header-only diagnosis may be insufficient. Also review application cache invalidation strategy and key design.

Referenced specs

  • RFC 9111 (HTTP Caching)
  • RFC 9110 (HTTP Semantics)
  • MDN: HTTP caching

FAQ

Which takes precedence: Cache-Control or Expires?

Cache-Control generally takes precedence. Treat Expires as a fallback.

Is Pragma still needed?

Mostly for legacy compatibility. Modern setups should center on Cache-Control.

References

  1. RFC 9111
  2. RFC 9110
  3. MDN: HTTP caching

Page-specific case studies

This overview is for policy design and directive precedence before implementation.

  • Design with Cache-Control precedence over Expires when both exist.
  • Treat Pragma as legacy compatibility only.
  • Interpret Age as residence time inside shared caches.

Page-specific implementation checklist

  • Document shared cache policy and align teams.
  • Maintain separate default templates for API, HTML, and static assets.
  • Audit conflicting directives during migration from legacy headers.
  • Review real-world response headers regularly after rollout.

These links are generated from site_map rules in recommended diagnostic order.

  1. Cache Not Working Troubleshooting — Troubleshoot cache-not-working symptoms step by step from headers
  2. HTTP Cache Mismatch — Identify root causes of cache mismatches
  3. Cache Response Analyzer — Judge cacheability from response headers
  4. How to Diagnose Stale Content After Deployment — Check cache policy by HTML/API/static assets to isolate stale deployment issues quickly
  5. How to choose cache tools — Route stale-update, missing-304, and CDN-only mismatch issues to the right tools
  6. Cache-Control Inspect — Parse and interpret Cache-Control directives
  7. Cache Key Inspect — Visualize cache-key splits from URL, Vary, and headers
  8. ETag Inspect — Parse ETag and If-None-Match consistency

Cache Control

Diagnose delivery policy across Cache-Control/Expires/Age