Skip to content

Commit

Permalink
fix: sw cache invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaskuske authored Nov 30, 2023
1 parent 2759ea7 commit 45dd0be
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions serviceworker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const CACHE_NAME = 'fluent-tab-v13'
const CACHE_NAME = 'fluent-tab-v14'

const staticAssets = [
'.',
Expand All @@ -17,11 +17,11 @@ const staticAssets = [
// get the filenames to cache from the parcel-manifest and add them to cache
self.addEventListener('install', event => {
event.waitUntil(
caches
.open(CACHE_NAME)
.then(cache => cache.addAll(staticAssets))
.then(() => self.skipWaiting())
)
caches
.open(CACHE_NAME)
.then((cache) => cache.addAll(staticAssets.map((url) => `${url}?v=${CACHE_NAME}`)))
.then(() => self.skipWaiting()),
)
})

/* delete old caches on activation */
Expand Down

0 comments on commit 45dd0be

Please sign in to comment.