fix(web): no-cache for index.html so new bundle hashes propagate

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
admin
2026-04-30 21:44:35 +03:00
parent 4965fdd60f
commit d9bd6fc68f
+8 -2
View File
@@ -4,12 +4,18 @@ server {
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html; index index.html;
# SPA fallback # SPA fallback. index.html НЕ кешируется (внутри ссылки на хешированные
# бандлы — если index закешируется, новые релизы не подтянутся).
location / { location / {
try_files $uri $uri/ /index.html; 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/ { location /assets/ {
access_log off; access_log off;
expires 1y; expires 1y;