fix(admin): 发版 chunk 自动刷新、nginx 缓存策略与审计页 i18n

lazy route 加载失败时刷新入口;index.html 不缓存;补全 audit.col.operator/ip 等拆包遗漏 key。
This commit is contained in:
2026-06-18 16:59:39 +08:00
parent c5a5e66bbd
commit c61d3c68f2
5 changed files with 55 additions and 2 deletions

View File

@@ -9,6 +9,17 @@ server {
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
# 带 hash 的静态资源可长期缓存index.html 禁止缓存,避免发版后引用旧 chunk
location /assets/ {
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
}
location = /index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
}
location /api/ {
proxy_pass http://api:3000;
proxy_http_version 1.1;

View File

@@ -10,6 +10,16 @@ server {
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
location /assets/ {
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
}
location = /index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
}
location /api/ {
set $api_upstream api:3000;
proxy_pass http://$api_upstream;