Skip to content

Commit

Permalink
fix: Update registerServiceWorker.js (delete all cache on when new ve…
Browse files Browse the repository at this point in the history
…rsion is released)

Empty the cache when a release is changed.
When the release data is refreshed, the page is updated without a forced refresh.
  • Loading branch information
m4ximuel committed Apr 2, 2021
1 parent e1ca41b commit d846c92
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/registerServiceWorker.js
Expand Up @@ -21,6 +21,9 @@ if (process.env.NODE_ENV === 'production') {
},
updated() {
console.log('New content is available; please refresh.')
caches.keys().then(function (names) {
for (const name of names) caches.delete(name)
})
},
offline() {
console.log(
Expand Down

0 comments on commit d846c92

Please sign in to comment.