diff --git a/web/src/sw.ts b/web/src/sw.ts index 4dc6da9..7dcb7e6 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 } from 'workbox-strategies' +import { StaleWhileRevalidate, CacheFirst } from 'workbox-strategies' import { registerRoute } from 'workbox-routing' declare let self: ServiceWorkerGlobalScope @@ -20,6 +20,8 @@ register('capabilities/buildmap', new StaleWhileRevalidate()) register('maps', new StaleWhileRevalidate({ cacheName: 'maps-20240527' })) +register('data', new CacheFirst({ cacheName: 'basemaps-20240529' })) + try { // Only catch requests to the root URL (a regex doesn't do this). registerRoute(