fix: Update registerServiceWorker.js (delete all cache on when new version is released)

Empty the cache when a release is changed.
When the release data is refreshed, the page is updated without a forced refresh.
This commit is contained in:
m4ximuel 2021-04-03 00:22:12 +09:00 committed by GitHub
parent e1ca41b917
commit d846c92493
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(