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
@@ -1,6 +1,11 @@
export function shouldSetDefaultNoCache(path: string, cacheControl?: string) {
if(path === '/' || path === '/index.html' ){
//首页不管怎样都不要缓存
return true;
}
if (cacheControl) {
return false;
}
return path === '/' || path === '/index.html' || path.startsWith('/api');
// api也不要缓存,如果他本身有设置缓存除外
return path.startsWith('/api');
}