include fonts in service worker

This commit is contained in:
adueck 2024-08-17 22:49:21 -04:00
parent 962a4c1faf
commit ca13436fb4
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ registerRoute(
registerRoute( registerRoute(
// Add in any other file extensions or routing criteria as needed. // Add in any other file extensions or routing criteria as needed.
({ url }) => ({ url }) =>
url.origin === self.location.origin && url.pathname.endsWith(".png"), url.origin === self.location.origin && ([".png", ".woff2", "woff"].some(ending => url.pathname.endsWith(ending)))
// Customize this strategy as needed, e.g., by changing to CacheFirst. // Customize this strategy as needed, e.g., by changing to CacheFirst.
new StaleWhileRevalidate({ new StaleWhileRevalidate({
cacheName: "images", cacheName: "images",