Cache-Control Builder

Build a Cache-Control header from presets or directives and see what each one does.

Cache-Control: public, max-age=31536000, immutable

What it means

  • public — Any cache (browser, CDN, proxy) may store the response — even for authenticated requests.
  • max-age=31536000 — Fresh for 1 year(s) in any cache.
  • immutable — The response will never change while fresh — browsers skip revalidation even on reload.
  • Only use immutable for files whose URL changes when the content changes (e.g. app.3f9c2.js).

Server configuration

location ~* \.(js|css|png|jpg|svg|woff2)$ {
    add_header Cache-Control "public, max-age=31536000, immutable";
}