summaryrefslogtreecommitdiff
path: root/src/components/BaseHead.astro
diff options
context:
space:
mode:
authorJoão Augusto Costa Branco Marado Torres <torres.dev@disroot.org>2025-07-04 21:14:34 -0300
committerJoão Augusto Costa Branco Marado Torres <torres.dev@disroot.org>2025-07-04 21:14:34 -0300
commite43b58379323144cb4067ec1329a2ccfaaa5cc5e (patch)
tree2a86ead36ad7b6c803f7f0f1018a8503b5f551e1 /src/components/BaseHead.astro
parent011c4266ccbf3ff66d92e223b2fafd291127c102 (diff)
fix: better caching
Signed-off-by: João Augusto Costa Branco Marado Torres <torres.dev@disroot.org>
Diffstat (limited to 'src/components/BaseHead.astro')
-rw-r--r--src/components/BaseHead.astro7
1 files changed, 6 insertions, 1 deletions
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",