From 5da4941913da5db3dea80bdbb75009088e6ab51a Mon Sep 17 00:00:00 2001 From: whm <973418690@qq.com> Date: Mon, 23 Mar 2026 16:43:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(admin):=20index.html=20=E4=B8=8E=20assets?= =?UTF-8?q?=20=E7=BC=93=E5=AD=98=E7=AD=96=E7=95=A5=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E5=8F=91=E7=89=88=E5=90=8E=E7=99=BD=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- deploy/admin/default.conf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/deploy/admin/default.conf b/deploy/admin/default.conf index c2d9937..aa446d4 100644 --- a/deploy/admin/default.conf +++ b/deploy/admin/default.conf @@ -3,6 +3,20 @@ server { listen 80; root /usr/share/nginx/html; index index.html; + + # 发版后勿长期缓存入口,否则浏览器保留旧 index.html、却拉新 chunk 名 → 白屏 + location = /index.html { + add_header Cache-Control "no-cache, no-store, must-revalidate"; + expires -1; + } + + location ^~ /assets/ { + try_files $uri =404; + access_log off; + expires 7d; + add_header Cache-Control "public, immutable"; + } + location / { try_files $uri $uri/ /index.html; }