This commit is contained in:
xiaojunnuo
2026-05-20 16:00:14 +08:00
parent fb5b00d73f
commit 1e7b057946
4 changed files with 12 additions and 5 deletions
@@ -126,7 +126,7 @@ export class MainConfiguration {
await next();
const path = ctx.path;
// 如果是首页则强制设置为不缓存
if (path === '/' || path === '/index.html' || shouldSetDefaultNoCache(path, ctx.response.get('Cache-Control')) ) {
if (shouldSetDefaultNoCache(path, ctx.response.get('Cache-Control')) ) {
ctx.response.set('Cache-Control', 'public,max-age=0');
}
});
@@ -138,6 +138,6 @@ export class MainConfiguration {
logger.info('当前环境:', this.app.getEnv()); // prod
// throw new Error("address family not supported")
}
}