From e26a9cd9ce6ef3ccd16553f34fdcac2a6f6bd2c9 Mon Sep 17 00:00:00 2001 From: Russ Garrett Date: Mon, 27 May 2024 18:04:45 +0100 Subject: [PATCH] Invalidate map cache --- web/src/sw.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/src/sw.ts b/web/src/sw.ts index 4849b63..4dc6da9 100644 --- a/web/src/sw.ts +++ b/web/src/sw.ts @@ -1,6 +1,6 @@ import { createHandlerBoundToURL, precacheAndRoute, cleanupOutdatedCaches } from 'workbox-precaching' import { clientsClaim } from 'workbox-core' -import { StaleWhileRevalidate, NetworkFirst } from 'workbox-strategies' +import { StaleWhileRevalidate } from 'workbox-strategies' import { registerRoute } from 'workbox-routing' declare let self: ServiceWorkerGlobalScope @@ -18,9 +18,7 @@ precacheAndRoute(self.__WB_MANIFEST) register('capabilities/buildmap', new StaleWhileRevalidate()) -// Cache map tiles using NetworkFirst for the moment - may be worth switching -// to StaleWhileRevalidate closer to the event. -register('maps', new StaleWhileRevalidate()) +register('maps', new StaleWhileRevalidate({ cacheName: 'maps-20240527' })) try { // Only catch requests to the root URL (a regex doesn't do this).