diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f22cae..fadc91c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.1 + +- FIXED system - HTML and JS frontend caches causing failures + ## 2.1.0 - ADDED roster - BMS section (available also from Landing page) diff --git a/deploy/nginx.conf b/deploy/nginx.conf index c236b0e..fe6715f 100644 --- a/deploy/nginx.conf +++ b/deploy/nginx.conf @@ -36,5 +36,10 @@ server { proxy_pass http://frontend:80; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; + + # Pass cache headers from frontend nginx + proxy_pass_header Cache-Control; + proxy_pass_header Pragma; + proxy_pass_header Expires; } } diff --git a/frontend/nginx.conf b/frontend/nginx.conf index aa892fc..c2a7a5f 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -22,6 +22,13 @@ server { add_header Cache-Control "no-cache, no-store, must-revalidate"; } + # Never cache index.html (SPA entry point — must always fetch latest) + location = /index.html { + add_header Cache-Control "no-cache, no-store, must-revalidate" always; + add_header Pragma "no-cache" always; + add_header Expires "0" always; + } + # API requests → backend (needed for OG bot rewrite) location ~ ^/api(/.*)?$ { proxy_pass http://backend:8000; @@ -41,7 +48,14 @@ server { try_files $uri $uri/ /index.html; } - # Cache static assets + # Vite hashed assets — no SPA fallback, real 404 if missing + location /assets/ { + expires 1y; + add_header Cache-Control "public, immutable"; + try_files $uri =404; + } + + # Cache other static assets location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { expires 1y; add_header Cache-Control "public, immutable";