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"; } }