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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user