Skip to content

Commit

Permalink
wip: Allow to make layers available offline - changed strategy to cac…
Browse files Browse the repository at this point in the history
…he first for layers (#353) [skip ci]
  • Loading branch information
claustres committed Oct 28, 2024
1 parent f902d8c commit 609ffef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src-pwa/custom-service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function fetchDidFail({ error, request }) {
logger.debug(`[Kano] Fetching ${request.url} from layers cache failed`)
}

// Register the `NetworkFirst` caching strategy for offline data
// Register the `CacheFirst` caching strategy for offline data
// targetting layers data
registerRoute(
({url, request}) => {
Expand All @@ -72,7 +72,7 @@ registerRoute(
}
return isCached
},
new NetworkFirst({
new CacheFirst({
cacheName: 'layers',
plugins : [{ cacheKeyWillBeUsed, fetchDidFail }]
})
Expand Down

0 comments on commit 609ffef

Please sign in to comment.