From 7295c9d243919e1dd7d986fc2b955e39131592f9 Mon Sep 17 00:00:00 2001 From: Claude Agent Date: Wed, 4 Mar 2026 10:57:01 +0000 Subject: [PATCH] fix(nginx): disable caching for index.html to prevent stale JS bundles Without Cache-Control: no-cache on index.html, browsers serve old cached HTML referencing outdated JS bundle hashes after deployment. Co-Authored-By: Claude Sonnet 4.6 --- frontend/nginx.conf | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 49e8974..ba39f92 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -14,8 +14,15 @@ server { proxy_set_header X-Forwarded-Proto $scheme; } - # SPA routing - all other routes serve index.html + # Cache static assets with content hash (JS, CSS) indefinitely + location ~* \.(js|css)$ { + try_files $uri =404; + add_header Cache-Control "public, max-age=31536000, immutable"; + } + + # SPA routing - index.html must never be cached location / { try_files $uri $uri/ /index.html; + add_header Cache-Control "no-cache, no-store, must-revalidate"; } }