From d9bd6fc68fe0e795f1ddaf4a424483ccaaa0b076 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 30 Apr 2026 21:44:35 +0300 Subject: [PATCH] fix(web): no-cache for index.html so new bundle hashes propagate Co-Authored-By: Claude Opus 4.7 (1M context) --- docker/nginx-spa.conf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docker/nginx-spa.conf b/docker/nginx-spa.conf index f9e2f7f..0c9e5ac 100644 --- a/docker/nginx-spa.conf +++ b/docker/nginx-spa.conf @@ -4,12 +4,18 @@ server { root /usr/share/nginx/html; index index.html; - # SPA fallback + # SPA fallback. index.html НЕ кешируется (внутри ссылки на хешированные + # бандлы — если index закешируется, новые релизы не подтянутся). location / { try_files $uri $uri/ /index.html; } + location = /index.html { + add_header Cache-Control "no-cache, no-store, must-revalidate" always; + add_header Pragma "no-cache" always; + expires 0; + } - # Долгий кэш для хэшированных ассетов Vite + # Долгий кэш для хэшированных ассетов Vite (имена меняются при ребилде). location /assets/ { access_log off; expires 1y;