mirror of
https://github.com/msfjarvis/msfjarvis.dev.git
synced 2024-06-03 04:18:56 +05:30
static: Update service worker cache
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
parent
803941bfa3
commit
fd5e13aa77
|
@ -1,5 +1,5 @@
|
||||||
const oldCaches = ['cache-v1', 'cache-v2']
|
const oldCaches = ['cache-v1', 'cache-v2', 'cache-v3']
|
||||||
const cacheName = 'cache-v3'
|
const cacheName = 'cache-v4'
|
||||||
const precacheResources = [
|
const precacheResources = [
|
||||||
'/',
|
'/',
|
||||||
'/posts/',
|
'/posts/',
|
||||||
|
@ -28,17 +28,12 @@ const precacheResources = [
|
||||||
'/posts/tools-for-effective-rust-development/index.html',
|
'/posts/tools-for-effective-rust-development/index.html',
|
||||||
'/posts/understanding-and-resolving-selinux-denials-on-android/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-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) {
|
for (id in oldCaches) {
|
||||||
caches.open(id).then(cache =>
|
self.caches.delete(id)
|
||||||
cache.keys().then(keys => {
|
|
||||||
for (let key of keys) {
|
|
||||||
cache.delete(key)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.addEventListener('install', event => {
|
self.addEventListener('install', event => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user