Add Cache-Control for immutable assets
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/withadd_header Cache-Control "public, max-age=31536000, immutable" - HTML and
__data.json:no-cacheor a shortmax-ageso deploys propagate - Consider
precompress: truein the adapter andgzip_static/brotli_staticin nginx
Read next
