mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-10-27 22:52:21 +00:00
seperate the cdn cache out
This commit is contained in:
1 parent
6a95c25a15
commit
12f177a813
1 file changed
+3
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user