From 44d0e9c300ec19c271cacd667815092bfd5f7e85 Mon Sep 17 00:00:00 2001 From: userquin Date: Thu, 2 Nov 2023 12:47:37 +0100 Subject: [PATCH] chore: switch web manifest handler to stale while revalidate handler --- service-worker/sw.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service-worker/sw.ts b/service-worker/sw.ts index 7b32873d..94c6e54d 100644 --- a/service-worker/sw.ts +++ b/service-worker/sw.ts @@ -3,7 +3,7 @@ import { cleanupOutdatedCaches, createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching' import { NavigationRoute, registerRoute } from 'workbox-routing' import { CacheableResponsePlugin } from 'workbox-cacheable-response' -import { NetworkFirst, StaleWhileRevalidate } from 'workbox-strategies' +import { StaleWhileRevalidate } from 'workbox-strategies' import { ExpirationPlugin } from 'workbox-expiration' import { onNotificationClick, onPush } from './web-push-notifications' @@ -56,7 +56,7 @@ if (import.meta.env.PROD) { registerRoute( ({ request, sameOrigin, url }) => sameOrigin && request.destination === 'manifest' && url.pathname.startsWith('/manifest-'), - new NetworkFirst({ + new StaleWhileRevalidate({ cacheName: 'elk-webmanifest', // responses with a Vary: Accept-Encoding header matchOptions: {