From 3d6add46368a27e023ff78638056f69b46d6350d Mon Sep 17 00:00:00 2001 From: admin <362324317@qq.com> Date: Sun, 17 May 2026 03:44:43 +0800 Subject: [PATCH] =?UTF-8?q?v0.3.1:=20=E4=BF=AE=E5=A4=8D=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E7=BC=93=E5=AD=98=E9=97=AE=E9=A2=98=20+=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复: admin.html 无缓存, /assets/ immutable + 1年缓存 - 修复: 清理过期 index-Bz21yOih.js 残留文件 - 版本: VERSION → 0.3.1 (唯一来源) --- VERSION | 2 +- source_clean/src/main.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0d91a54..9e11b32 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.0 +0.3.1 diff --git a/source_clean/src/main.ts b/source_clean/src/main.ts index 2f59132..ca5f6b8 100755 --- a/source_clean/src/main.ts +++ b/source_clean/src/main.ts @@ -42,6 +42,15 @@ app.use(rateLimiter); // ============ 前端静态文件 ============ const frontendDist = path.join(__dirname, 'frontend'); +// Cache control: HTML no-cache, hashed assets immutable +app.use((req, res, next) => { + if (req.path.endsWith('.html')) { + res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate'); + } else if (req.path.startsWith('/assets/')) { + res.setHeader('Cache-Control', 'public, max-age=31536000, immutable'); + } + next(); +}); app.use(express.static(frontendDist)); // ============ Routes ============