From b605085abb5510ce26ec23743339b6c35688cb30 Mon Sep 17 00:00:00 2001 From: Okiki Ojo Date: Mon, 26 Jan 2026 00:57:05 -0500 Subject: [PATCH] chore: web cache api delete ops aren't supported on deno deploy Signed-off-by: Okiki Ojo --- utils/fetch-and-cache.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/utils/fetch-and-cache.ts b/utils/fetch-and-cache.ts index 396e226..c79c812 100644 --- a/utils/fetch-and-cache.ts +++ b/utils/fetch-and-cache.ts @@ -409,7 +409,9 @@ export async function clearCache(): Promise { redirectMap.clear(); if (SUPPORTS_CACHE_API) { - await caches.delete(CACHE_NAME); + try { + await caches.delete(CACHE_NAME); + } catch (e) { console.error(e) } openCachePromise = null; } } @@ -424,8 +426,10 @@ export async function invalidate(url: string): Promise { redirectMap.delete(url); if (SUPPORTS_CACHE_API) { - const cache = await openCache(); - await cache.delete(finalUrl); + try { + const cache = await openCache(); + await cache.delete(finalUrl); + } catch (e) { console.error(e) } } } @@ -449,6 +453,4 @@ export async function getRequest( }); return response; -} - -await clearCache() \ No newline at end of file +} \ No newline at end of file -- knotmirror 0.0.1