fix: fonts not cached by service worker (#2338)
This commit is contained in:
parent
dcedd17f57
commit
2a20c44338
@ -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 })],
|
||||
}),
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user