gr-apollo/docs/Caddyfile
Ryan Malloy 04a17899fc Fix cache headers: immutable for hashed assets, revalidate for HTML
The blanket max-age=3600 caused stale HTML pages after redeployment.
Now _astro/* gets immutable (content-addressed filenames) and HTML
pages get no-cache (always revalidate, 304 when unchanged).
2026-02-24 11:16:58 -07:00

16 lines
376 B
Caddyfile

:80 {
root * /srv
file_server
encode gzip zstd
# Hashed assets: cache forever (filename changes on content change)
@hashed path /_astro/*
header @hashed Cache-Control "public, max-age=31536000, immutable"
# Everything else (HTML pages): always revalidate
@unhashed not path /_astro/*
header @unhashed Cache-Control "no-cache"
try_files {path} {path}/ /404.html
}