Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix: fonts not cached by service worker (#2338)

Noel Schnierer2a20c44338ab
diff --git a/src/service-worker.js b/src/service-worker.js
index 14da5bd275..b84e88f6f6 100644
--- a/src/service-worker.js
+++ b/src/service-worker.js
@@ -36,3 +36,12 @@ workbox.routing.registerNavigationRoute(
blacklist: [/^\/_/, /\/[^/?]+\.[^/]+$/],
},
);
+
+// Cache relevant font files
+workbox.routing.registerRoute(
+ new RegExp("/(fonts.css|.+.(ttf|woff2|otf))"),
+ new workbox.strategies.StaleWhileRevalidate({
+ cacheName: "fonts",
+ plugins: [new workbox.expiration.Plugin({ maxEntries: 10 })],
+ }),
+);