static: Update service worker cache

Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
Harsh Shandilya 2019-09-30 19:15:42 +05:30
parent 803941bfa3
commit fd5e13aa77
1 changed files with 5 additions and 10 deletions

View File

@ -1,5 +1,5 @@
const oldCaches = ['cache-v1', 'cache-v2']
const cacheName = 'cache-v3'
const oldCaches = ['cache-v1', 'cache-v2', 'cache-v3']
const cacheName = 'cache-v4'
const precacheResources = [
'/',
'/posts/',
@ -28,17 +28,12 @@ const precacheResources = [
'/posts/tools-for-effective-rust-development/index.html',
'/posts/understanding-and-resolving-selinux-denials-on-android/index.html',
'/posts/teaching-kotlin-kotlin-for-android-java-developers/index.html',
'/posts/teaching-kotlin-classes-and-objects/index.html'
'/posts/teaching-kotlin-classes-and-objects/index.html',
'/posts/teaching-kotlin-variables/index.html'
]
for (id in oldCaches) {
caches.open(id).then(cache =>
cache.keys().then(keys => {
for (let key of keys) {
cache.delete(key)
}
})
)
self.caches.delete(id)
}
self.addEventListener('install', event => {