From 1e649a1bc1dd461123a72b123213f25a8b83fc9e Mon Sep 17 00:00:00 2001 From: Michel NAUD Date: Thu, 12 Mar 2026 20:20:43 +0100 Subject: [PATCH 1/2] fix html and js cache errors --- CHANGELOG.md | 4 ++++ deploy/nginx.conf | 5 +++++ frontend/nginx.conf | 16 +++++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f22cae..da4258c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.1 + +- FIXED system - html and js frontend cache cause 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..13c8974 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"; + add_header Pragma "no-cache"; + add_header Expires "0"; + } + # 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"; From 556cd148764b4a8131f6355b0b05071b4058ed98 Mon Sep 17 00:00:00 2001 From: Michel NAUD Date: Thu, 12 Mar 2026 20:26:14 +0100 Subject: [PATCH 2/2] apply feedback --- CHANGELOG.md | 2 +- frontend/nginx.conf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da4258c..fadc91c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 2.1.1 -- FIXED system - html and js frontend cache cause failures +- FIXED system - HTML and JS frontend caches causing failures ## 2.1.0 diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 13c8974..c2a7a5f 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -24,9 +24,9 @@ server { # Never cache index.html (SPA entry point — must always fetch latest) location = /index.html { - add_header Cache-Control "no-cache, no-store, must-revalidate"; - add_header Pragma "no-cache"; - add_header Expires "0"; + 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)