Files
certd/packages/ui/certd-server/src/configuration-cache.ts
T

12 lines
331 B
TypeScript
Raw Normal View History

2026-05-15 00:39:35 +08:00
export function shouldSetDefaultNoCache(path: string, cacheControl?: string) {
2026-05-31 01:41:33 +08:00
if (path === "/" || path === "/index.html") {
2026-05-20 16:00:14 +08:00
//首页不管怎样都不要缓存
return true;
}
2026-05-15 00:39:35 +08:00
if (cacheControl) {
return false;
}
2026-05-20 16:00:14 +08:00
// api也不要缓存,如果他本身有设置缓存除外
2026-05-31 01:41:33 +08:00
return path.startsWith("/api");
2026-05-15 00:39:35 +08:00
}