From 4b821b89df173c328c31e5017f0e89cf70afe1a9 Mon Sep 17 00:00:00 2001 From: lobo Date: Thu, 24 Sep 2026 09:32:06 +0200 Subject: [PATCH] fix(nginx): revalidate index.html and translations on every load i18n/*.json and index.html keep their names across deploys, so browsers kept old files and showed raw keys like NAV.DASHBOARD. Hashed /assets/ now get a one-year immutable cache. --- nginx.conf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 3fba025..575f511 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,11 +1,19 @@ server { listen 80; + root /usr/share/nginx/html; + # Vite puts a content hash in these file names, so they never change. + location /assets/ { + add_header Cache-Control "public, max-age=31536000, immutable"; + } + + # index.html and /i18n/*.json keep their names across deploys. Without + # no-cache the browser shows old translation keys or loads an old bundle. location / { - root /usr/share/nginx/html; index index.html index.htm; + add_header Cache-Control "no-cache"; # Handle React Router navigation try_files $uri $uri/ /index.html; } -} \ No newline at end of file +}