Add no-cache headers for HTML files

Prevents browser caching of index.html to ensure fresh asset references
after deployments. Static assets remain cached with immutable flag.
This commit is contained in:
fullsizemalt 2026-01-09 01:30:39 -08:00
parent 6bdc23b9d3
commit 38ddfb00e3

View file

@ -36,9 +36,16 @@ server {
add_header Cache-Control "public, max-age=31536000, immutable"; add_header Cache-Control "public, max-age=31536000, immutable";
} }
# HTML files - no cache to ensure fresh asset references
location ~* \.(html)$ {
try_files $uri =404;
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# Frontend SPA routing # Frontend SPA routing
location / { location / {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache, no-store, must-revalidate";
} }
# Security headers # Security headers