Add fonts to service-worker workbox cache
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
8b90aa0775
commit
637c7055c7
@ -42,10 +42,11 @@ registerRoute(
|
|||||||
|
|
||||||
// Cache CSS, JS, and Web Worker requests with a Stale While Revalidate strategy
|
// Cache CSS, JS, and Web Worker requests with a Stale While Revalidate strategy
|
||||||
registerRoute(
|
registerRoute(
|
||||||
// Check to see if the request's destination is style for stylesheets, script for JavaScript, or worker for web worker
|
// Check to see if the request's destination is style for stylesheets, script for JavaScript, font, or worker for web worker
|
||||||
({ request }) =>
|
({ request }) =>
|
||||||
request.destination === "style" ||
|
request.destination === "style" ||
|
||||||
request.destination === "script" ||
|
request.destination === "script" ||
|
||||||
|
request.destination === "font" ||
|
||||||
request.destination === "worker",
|
request.destination === "worker",
|
||||||
// Use a Stale While Revalidate caching strategy
|
// Use a Stale While Revalidate caching strategy
|
||||||
new StaleWhileRevalidate({
|
new StaleWhileRevalidate({
|
||||||
|
Loading…
Reference in New Issue
Block a user