optimize disabled cache

This commit is contained in:
Min Idzelis 2025-06-05 15:50:03 +00:00
parent 56cb8316a1
commit f8f21dafeb

View File

@ -75,8 +75,11 @@ async function fetchWithCancellation(request: URL | Request | string, cache: Cac
} }
async function checkCache(url: URL | Request | string) { async function checkCache(url: URL | Request | string) {
if (!useCache) {
return;
}
const cache = await caches.open(CACHE); const cache = await caches.open(CACHE);
const response = useCache ? await cache.match(url) : undefined; const response = await cache.match(url);
return { cache, response }; return { cache, response };
} }