What is Cache-Control Headers?
Response headers telling browsers and CDNs how long to reuse a file. This site serves its RSS feed with a one-hour public cache, while hashed static assets can carry far longer lifetimes because filenames change on rebuild.
Example
The blog RSS endpoint returns public cache headers with a one-hour lifetime, so feed readers refetch hourly without hammering the origin — a small server file setting with outsized bandwidth savings.
What people get wrong
Caching HTML as aggressively as hashed assets is the classic mistake: visitors then see yesterday’s headlines. Cache versioned files long, revalidate markup short, and never confuse the two.
Frequently asked questions
Why can hashed assets cache longer than HTML?
A new build writes new filenames, so old cached copies can never shadow fresh code. HTML keeps its URL across deploys, so it needs short lifetimes or revalidation to stay fresh.
Related terms
Immutable Hashed Assets
Static files with content hashes in their filenames, emitted under the immutable build output. When code changes the hash changes, so browsers safely cache each version forever without risking stale JavaScript or styles.
Edge-Cached HTML
Caching rendered HTML at CDN edge nodes close to visitors. Edge HTML caching cuts time to first byte for repeat views, but dynamic or personalized pages need careful keys or bypass rules to avoid serving one user’s markup to another.
Caching
Storing responses at the browser, CDN, or edge so repeat visits skip origin work. Correct cache headers and edge caching are usually the cheapest large performance win available.
SSR Per Request
Fresh HTML rendered on the server for every request, used for personalized or frequently changing pages. Server rendering guarantees complete markup on first paint but costs compute per visit, so reserve it for dynamic routes.
CSR Shell
A minimal HTML shell that renders content in the browser after JavaScript loads. Client rendering suits authenticated dashboards behind login, where SEO matters less and interactivity starts only after scripts execute.
Hydration Cost
The JavaScript work that turns server-rendered HTML into an interactive app. Hydration replays component logic in the browser, so oversized bundles delay input readiness even when paint looks instant.