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 ============