mirror of
https://github.com/certd/certd.git
synced 2026-06-15 21:57:33 +08:00
12 lines
330 B
TypeScript
12 lines
330 B
TypeScript
export function shouldSetDefaultNoCache(path: string, cacheControl?: string) {
|
|
if(path === '/' || path === '/index.html' ){
|
|
//首页不管怎样都不要缓存
|
|
return true;
|
|
}
|
|
if (cacheControl) {
|
|
return false;
|
|
}
|
|
// api也不要缓存,如果他本身有设置缓存除外
|
|
return path.startsWith('/api');
|
|
}
|