Skip to main content

Cloudflare Cache TTL & Cache-Control Calculator

New

Build Cache-Control headers with max-age, s-maxage and stale-while-revalidate, get a Cloudflare _headers snippet, and estimate cache hit ratio and origin load.

cache-control generatorcloudflare cache ttls-maxagestale-while-revalidatecdn cache calculator
Read the guide
Shortcuts:⌘ KSearch
Cache-Control header
Cloudflare _headers
Estimate origin load

Estimate assumes each URL is refetched from origin once per edge TTL in a single location (Cloudflare caches per data center, so real misses are higher, though Tiered Cache reduces them) and evenly spread traffic.

Continue with:

Frequently Asked Questions

What is the difference between max-age and s-maxage?

max-age applies to browsers and all caches; s-maxage applies only to shared caches such as CDNs and overrides max-age there.

When should I use immutable?

For fingerprinted assets whose URL changes when content changes.

Is the hit-ratio exact?

No, it is a simple estimate; real ratios depend on data centers, eviction and traffic patterns.

Does Cloudflare respect these headers?

Cloudflare honours origin Cache-Control for cacheable file types, subject to your cache rules.

Related Tools