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:
parent
6bdc23b9d3
commit
38ddfb00e3
1 changed files with 7 additions and 0 deletions
|
|
@ -36,9 +36,16 @@ server {
|
|||
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
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
}
|
||||
|
||||
# Security headers
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue