seperate the cdn cache out

This commit is contained in:
MathMan05 committed 2025-12-13 16:35:38 -06:00
1 parent 6a95c25a15
commit 12f177a813
1 file changed
+3 -2
+3 -2
View File
@@ -37,16 +37,17 @@ async function getFromCache(request: URL) {
if (port) {
request.search = "";
}
const cache = await caches.open("cache");
const cache = await caches.open(port ? "cdn" : "cache");
return cache.match(request);
}
async function putInCache(request: URL | string, response: Response) {
const cache = await caches.open("cache");
request = new URL(request, self.location.href);
const port = rMap.get(request.host);
if (port) {
request.search = "";
}
const cache = await caches.open(port ? "cdn" : "cache");
try {
console.log(await cache.put(request, response));
} catch (error) {