From 637c7055c716a1eecd9908767cce1fb0d696190c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 18 Jun 2021 18:41:09 +0200 Subject: [PATCH] Add fonts to service-worker workbox cache Signed-off-by: Thomas Citharel --- js/src/service-worker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/src/service-worker.ts b/js/src/service-worker.ts index e87c5cce7..ee8ae6179 100644 --- a/js/src/service-worker.ts +++ b/js/src/service-worker.ts @@ -42,10 +42,11 @@ registerRoute( // Cache CSS, JS, and Web Worker requests with a Stale While Revalidate strategy 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.destination === "style" || request.destination === "script" || + request.destination === "font" || request.destination === "worker", // Use a Stale While Revalidate caching strategy new StaleWhileRevalidate({