diff --git a/about.html b/about.html index 7bae2f3..631a40a 100644 --- a/about.html +++ b/about.html @@ -2,7 +2,7 @@
- Version 3.7.0: - + Version 3.7.1: + Changelog
diff --git a/service-worker.js b/service-worker.js index 5f0da28..6cff194 100644 --- a/service-worker.js +++ b/service-worker.js @@ -1,9 +1,18 @@ -const PRECACHE = 'precache-v7'; -const RUNTIME = 'runtime-v7'; +const PRECACHE = 'precache-v3.7.1'; +const RUNTIME = 'runtime-v3.7.1'; // A list of local resources we always want to be cached. const PRECACHE_URLS = [ - 'about.html' + '/about.html', + '/main.js', + '/resizeListen,js', + '/about.css', + '/normalize.css', + '/weatherIcons/sunny.png', + '/weatherIcons/partlyCloudy.png', + '/weatherIcons/cloudy.png', + '/weatherIcons/rainy.png', + '/weatherIcons/thunderStorm.png' ]; // The install handler takes care of precaching the resources we always need. @@ -29,32 +38,7 @@ self.addEventListener('activate', event => { ); }); -// The fetch handler serves responses for same-origin resources from a cache. -// If no response is found, it populates the runtime cache with the response -// from the network before returning it to the page. - -/*self.addEventListener('fetch', event => { - // Skip cross-origin requests, like those for Google Analytics. - if (event.request.url.startsWith(self.location.origin)) { - event.respondWith( - caches.match(event.request).then(cachedResponse => { - if (cachedResponse) { - return cachedResponse; - } - - return caches.open(RUNTIME).then(cache => { - return fetch(event.request).then(response => { - // Put a copy of the response in the runtime cache. - return cache.put(event.request, response.clone()).then(() => { - return response; - }); - }); - }); - }) - ); - } -});*/ - +// The fetch handler serves cached assets if available, otherwise fetches them from the server self.addEventListener('fetch', function(event) { if (event.request.cache === 'only-if-cached' && event.request.mode !== 'same-origin') { return;