From ce25a4460eb63f12ec7fe2e97077568a256511e6 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 9 Apr 2026 11:42:16 +0200 Subject: [PATCH] fix: never cache index.html so new bundle hashes are picked up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vite content-hashes the JS/CSS bundle filenames, but the only thing that tells the browser to fetch a new hash is a fresh index.html. Without explicit no-cache headers nginx falls back to heuristic caching, so users keep loading the old index.html → old bundle hash until they hard-reload. Just hit this rolling out the timeline pagination fix. Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/nginx.conf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/nginx.conf b/frontend/nginx.conf index a372a87..76ccfa7 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -35,7 +35,18 @@ server { try_files $uri $uri/ /index.html; } - # Cache static assets + # Never cache index.html (or any HTML). The asset filenames are + # content-hashed by Vite, so a fresh index.html is the only thing + # that tells the browser to fetch the new bundle. Without this the + # browser happily serves a stale index.html → stale bundle hash → + # users see the old build until they hard-reload. + location = /index.html { + add_header Cache-Control "no-cache, no-store, must-revalidate"; + add_header Pragma "no-cache"; + expires 0; + } + + # Cache static assets (filenames are content-hashed, so 1y is safe) location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { expires 1y; add_header Cache-Control "public, immutable";