Skip to content

Commit

Permalink
Invalidate map cache
Browse files Browse the repository at this point in the history
  • Loading branch information
russss committed May 27, 2024
1 parent 4645c2c commit e26a9cd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions web/src/sw.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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).
Expand Down

0 comments on commit e26a9cd

Please sign in to comment.