1const CACHE_NAME = 'myenovation-cache-v1'; 2const urlsToCache = [ 3 '/', 4 '/index.html', 5 '/src/shared/server-down/server-down.html', 6 '/assests/images/offline.png', // Add your images so they show up offline! 7 '/assests/images/logo 2.png' 8]; 9 10self.addEventListener('install', event => { 11 event.waitUntil( 12 caches.open(CACHE_NAME).then(cache => cache.addAll(urlsToCache)) 13 ); 14}); 15 16self.addEventListener('fetch', event => { 17 // ONLY intercept "navigate" (full page loads/refreshes) 18 if (event.request.mode === 'navigate') { 19 event.respondWith( 20 fetch(event.request).catch(() => { 21 return caches.match('/src/shared/server-down/server-down.html'); 22 }) 23 ); 24 } else { 25 // For APIs and Scripts, just let them fail normally 26 // so Angular can catch the error and redirect. 27 event.respondWith(fetch(event.request)); 28 } 29});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.