diff options
| -rw-r--r-- | .jekyll-metadata | bin | 31109 -> 31107 bytes | |||
| -rw-r--r-- | assets/sw.js | 12 |
2 files changed, 10 insertions, 2 deletions
diff --git a/.jekyll-metadata b/.jekyll-metadata index 558b6e7..b1f6ad8 100644 --- a/.jekyll-metadata +++ b/.jekyll-metadata | |||
| Binary files differ | |||
diff --git a/assets/sw.js b/assets/sw.js index 8f285e9..ebf08c2 100644 --- a/assets/sw.js +++ b/assets/sw.js | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | importScripts('/assets/cache-polyfill.js'); | 1 | importScripts('/assets/cache-polyfill.js'); |
| 2 | 2 | ||
| 3 | |||
| 4 | self.addEventListener('install', function (e) { | 3 | self.addEventListener('install', function (e) { |
| 5 | e.waitUntil( | 4 | e.waitUntil( |
| 6 | caches.open('airhorner').then(function (cache) { | 5 | caches.open('mitjafelicijan').then(function (cache) { |
| 7 | return cache.addAll([ | 6 | return cache.addAll([ |
| 8 | '/', | 7 | '/', |
| 9 | '/index.html', | 8 | '/index.html', |
| @@ -14,3 +13,12 @@ self.addEventListener('install', function (e) { | |||
| 14 | }) | 13 | }) |
| 15 | ); | 14 | ); |
| 16 | }); | 15 | }); |
| 16 | |||
| 17 | self.addEventListener('fetch', function (event) { | ||
| 18 | console.log(event.request.url); | ||
| 19 | event.respondWith( | ||
| 20 | caches.match(event.request).then(function (response) { | ||
| 21 | return response || fetch(event.request); | ||
| 22 | }) | ||
| 23 | ); | ||
| 24 | }); | ||
