This commit is contained in:
antelle 2019-09-28 20:36:26 +02:00
parent a451b4ec78
commit 2321d42e67
3 changed files with 21 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,4 @@
CACHE MANIFEST
# 2019-09-20:v1.10.1
# 2019-09-28:v1.11.0
# updmin:v6.0.2
CACHE:
index.html
NETWORK:
*

19
service-worker.js Normal file
View File

@ -0,0 +1,19 @@
const VERSION = '1.11.0';
self.addEventListener('install', event =>
event.waitUntil(
caches.open('v1').then(cache =>
fetch('.?v=' + VERSION).then(response => {
if (response.ok) {
return cache.put('.', response);
}
})
)
)
);
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request.url).then(response => response || fetch(event.request))
);
});