Skip to content
BEAD

Cache-Control Header Builder

Build HTTP Cache-Control headers with presets for static assets, APIs, and private responses.

Cache-Control header
Cache-Control: public, max-age=3600
Browser caches for
1 hour
CDN caches for
1 hour

Public vs private

public lets shared caches (CDNs, proxies) store the response. privaterestricts it to the user's own browser cache — use it for anything personalized.

max-age vs s-maxage

max-age applies to every cache. s-maxageoverrides it for shared caches, so you can tell your CDN to cache longer than the browser does.

stale-while-revalidate

Lets a cache serve the stale response while it fetches a fresh copy in the background — a popular pattern for SWR-style UX.

You might also like