From e43b58379323144cb4067ec1329a2ccfaaa5cc5e Mon Sep 17 00:00:00 2001 From: João Augusto Costa Branco Marado Torres Date: Fri, 4 Jul 2025 21:14:34 -0300 Subject: fix: better caching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Augusto Costa Branco Marado Torres --- src/components/BaseHead.astro | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/components/BaseHead.astro') diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index 41926ad..65e568c 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -98,9 +98,14 @@ const { const wb = new Workbox("/sw.js", { type: "module" }); wb.addEventListener("activated", (_event) => { + if (!location.pathname.startsWith("/blog/read/")) { + return; + } const urlsToCache = [ location.href, - ...performance.getEntriesByType("resource").map((r) => r.name), + location.href + ".md", + location.href + ".md.sig", + ///...performance.getEntriesByType("resource").map((r) => r.name), ]; wb.messageSW({ type: "CACHE_URLS", -- cgit v1.2.3