curl -I .../_app/immutable/entry/start.*.js returns etag and content-encoding: gzip but no Cache-Control. Every JS chunk, CSS file, font and AVIF is content-hashed, so it can be cached for a year. Fonts (97 KB) and the largest chunks are re-validated on every page view today.

Tasks

  • nginx: location /_app/immutable/ with add_header Cache-Control "public, max-age=31536000, immutable"
  • HTML and __data.json: no-cache or a short max-age so deploys propagate
  • Consider precompress: true in the adapter and gzip_static/brotli_static in nginx

Cache what never changes

One nginx location block

A static site template built with SvelteKit.

Sveleton, 2025