Cache-Control Header Generator
Pick your caching directives and copy the exact Cache-Control header — plus ready-to-paste nginx and Apache snippets. Runs entirely in your browser; nothing is sent anywhere.
1 · Choose directives
2 · Copy the result
On CDN.com.tr you don't edit config files — set caching per path from Delivery Rules in the panel, and these directives map to the same options.
What each Cache-Control directive does
The Cache-Control header tells browsers and CDN/proxy caches whether, where and how long they may store a response. Getting it right is one of the biggest wins for page speed and origin load. Here's what each directive above means.
public vs private
public lets any cache — including a CDN or shared proxy — store the response. private restricts storage to the end user's browser only; use it for personalized or authenticated responses that must never be served to another user.
max-age & s-maxage
max-age=N is how many seconds the response stays "fresh" (served without revalidation). s-maxage=N overrides max-age for shared caches (your CDN), so you can cache long at the edge while keeping browsers on a shorter window — e.g. max-age=0, s-maxage=3600.
no-cache vs no-store
They sound similar but differ: no-cache allows caching but forces revalidation with the origin before every reuse (good for HTML that changes). no-store forbids caching entirely — nothing is written to any cache; use it for sensitive, per-request data.
stale-while-revalidate & stale-if-error
stale-while-revalidate=N lets a cache serve a slightly stale response instantly while it refreshes in the background — visitors never wait on the origin. stale-if-error=N serves the last good copy if the origin is down, keeping your site up during incidents.
immutable
Signals that the content will never change during its max-age, so browsers skip revalidation even on reload. Ideal for fingerprinted/hashed static assets like app.9f2c1.js — pair with a long max-age: public, max-age=31536000, immutable.
must-revalidate & proxy-revalidate
Once a response becomes stale, must-revalidate forbids serving it without checking the origin first (no silent stale delivery). proxy-revalidate applies the same rule to shared caches only, leaving browsers more leeway.
Common recipes
Hashed static asset: public, max-age=31536000, immutable — cache "forever", the hash changes when the file does.
HTML behind a CDN: public, max-age=0, s-maxage=3600, stale-while-revalidate=86400 — browsers always revalidate, the edge serves cached HTML and refreshes in the background.
Personalized/authenticated: private, no-store — never cached by the CDN or shared proxies.
Want these rules applied automatically?
CDN.com.tr sets cache headers per path from the panel — no config files, with edge caching, Auto SSL and WAF included.