1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00
node-feature-discovery/v0.9/sw.caches.js
Github Actions 96d505b9f3 Update documentation for v0.9
Auto-generated from v0.9.0 by 'update-gh-pages.sh'
2021-08-20 04:24:44 +00:00

1 line
No EOL
725 B
JavaScript

self.addEventListener("activate", function (event) { const current = ["rundocs-2.0.9"]; event.waitUntil( caches.keys().then(function (keyList) { return Promise.all( keyList.map(function (key) { if (current.indexOf(key) === -1) { return caches.delete(key); } }) ); }) ); }); self.addEventListener("fetch", function (e) { if (e.request.url.match("rundocs/jekyll-rtd-theme@2.0.9")) { e.respondWith( caches.match(e.request).then(function (resp) { if (resp !== undefined) { return resp; } else { return fetch(e.request, { cache: "no-store", }) .then(function (resp) { let clone = resp.clone(); caches.open("rundocs-2.0.9").then(function (cache) { cache.put(e.request, clone); }); return resp; }) .catch(console.log); } }) ); } });