1const staticCacheFiles = [ 2 '/offline/', 3 '/manifest.webmanifest', 4 '/styles/themes/_hillarys-theme.css?t=5dnu-DsEJhEdDbRRBqHMm', 5 '/styles/themes/_luxaflex-theme.css?t=5dnu-DsEJhEdDbRRBqHMm', 6 '/styles/globals.css?t=5dnu-DsEJhEdDbRRBqHMm', 7 '/assets/fonts/juana/juana-bold.woff2', 8 '/assets/fonts/proxima-nova/proxima-nova-bold.woff2', 9 '/assets/fonts/proxima-nova/proxima-nova-semibold.woff2', 10 '/assets/fonts/proxima-nova/proxima-nova-regular.woff2', 11 '/assets/icons/core/icons-sprite.svg', 12 '/_next/static/chunks/polyfills-42372ed130431b0a.js', 13'/_next/static/chunks/webpack-334460b1a559ce3a.js', 14'/_next/static/chunks/4bd1b696-d0827a140e15e2b7.js', 15'/_next/static/chunks/9826-8bfe28b5ad46c236.js', 16'/_next/static/chunks/main-app-5e942a3aa94132c5.js', 17'/_next/static/chunks/framework-494577920120afaf.js', 18'/_next/static/chunks/main-d648955b4c4ed0e1.js', 19'/_next/static/chunks/pages/_app-41d721892665f081.js', 20'/_next/static/5dnu-DsEJhEdDbRRBqHMm/_buildManifest.js', 21'/_next/static/5dnu-DsEJhEdDbRRBqHMm/_ssgManifest.js', 22'/_next/static/css/1e08f1b21529fd27.css', 23'/_next/static/css/3295b65f600b10f7.css', 24'/_next/static/css/461d5fde44ce593c.css', 25'/_next/static/css/494dc44176915889.css', 26'/_next/static/css/598a0e048a88f49f.css', 27'/_next/static/css/59f8a9af95459b9a.css', 28'/_next/static/css/74837ebbaa2461ab.css', 29'/_next/static/css/7a55295f5f2b2e6a.css', 30'/_next/static/css/7e7263f282b0ebaf.css', 31'/_next/static/css/8599fcfb76ddcde0.css', 32'/_next/static/css/9610c48a60f9c510.css', 33'/_next/static/css/a19b0358518997fc.css', 34'/_next/static/css/a43f51beee78d49b.css', 35'/_next/static/css/a7c87748709fbc11.css', 36'/_next/static/css/b615c48cab7065d1.css', 37'/_next/static/css/d289c8b84de824af.css', 38'/_next/static/css/d28fff909bc46507.css', 39'/_next/static/css/d89305f7c97f7f90.css', 40'/_next/static/css/e163296e351389d4.css', 41 ]; 42 43 // Add any CDN or external files you want to cache here 44 const externalCacheFiles = [ 45 'https://hdelevate.cdn.prismic.io/hdelevate/aY82dFWLo0XkEf4P_HillarysForthewindowwiseMasterlogo_RGB-2--1-.svg', 46'https://images.prismic.io/hdelevate/aFlF43fc4bHWinQd_hil-24-poodle-and-blonde-double-pinch-curtain-money-tree-living-03-1.webp', 47'https://hdelevate.cdn.prismic.io/hdelevate/aAk7B_IqRLdaBiXq_Measured%26Fitted.svg', 48 ]; 49 50 // Customize this with a different URL if needed. 51 const offlineUrl = '/offline/'; 52 53 const cacheName = 'hillarys-cache-v1790342530617'; 54 55 const handlePrecacheResources = async () => { 56 const cache = await caches.open(cacheName); 57 return Promise.all(externalCacheFiles.map(async (url) => { 58 try { 59 const res = await fetch(url); 60 if (res.ok) { 61 return cache.put(url, res); 62 } 63 } catch(e) { 64 console.warn('Failed to fetch external resource:', url, e.message); 65 } 66 })); 67 } 68 69 self.addEventListener('install', function (event) { 70 event.waitUntil((async () => { 71 const cache = await caches.open(cacheName); 72 await cache.add(new Request(offlineUrl, { cache: 'reload', credentials: 'same-origin' })); 73 await cache.addAll(staticCacheFiles.map(url => new Request(url, { credentials: 'same-origin' }))); 74 })()); 75 // Force the waiting service worker to become the active service worker. 76 self.skipWaiting(); 77 }); 78 79 self.addEventListener('activate', (event) => { 80 event.waitUntil( 81 (async () => { 82 // Enable navigation preload if it's supported. 83 // See https://developers.google.com/web/updates/2017/02/navigation-preload 84 if ('navigationPreload' in self.registration) { 85 await self.registration.navigationPreload.enable(); 86 } 87 await handlePrecacheResources(); 88 })() 89 ); 90 91 // Tell the active service worker to take control of the page immediately. 92 self.clients.claim(); 93 }); 94 95 self.addEventListener('fetch', (event) => { 96 // Only call event.respondWith() if this is a navigation request 97 // for an HTML page. 98 const requestUrl = event.request.url.replace(/^.*\/\/[^\/]+/, ''); 99 if (event.request.mode === 'navigate') { 100 event.respondWith( 101 (async () => { 102 try { 103 // First, try to use the navigation preload response if it's 104 // supported. 105 const preloadResponse = await event.preloadResponse; 106 if (preloadResponse) { 107 return preloadResponse; 108 } 109 110 // Always try the network first. 111 const networkResponse = await fetch(event.request); 112 return networkResponse; 113 } catch (error) { 114 // catch is only triggered if an exception is thrown, which is 115 // likely due to a network error. 116 // If fetch() returns a valid HTTP response with a response code in
117 // the 4xx or 5xx range, the catch() will NOT be called. 118 console.log('Fetch failed; returning offline page instead.', error); 119 120 const cache = await caches.open(cacheName); 121 const cachedResponse = await cache.match(offlineUrl); 122 return cachedResponse; 123 } 124 })() 125 ); 126 return; 127 } 128 129 if (staticCacheFiles.includes(requestUrl)) { 130 event.respondWith(caches.match(requestUrl) 131 .then(cacheResponse => cacheResponse || fetch(event.request))); 132 return; 133 } 134 135 const externalUrl = event.request.url.indexOf('//') !== -1 ? event.request.url.split('?')[0] : null; 136 if (externalUrl && externalCacheFiles.includes(externalUrl)) { 137 event.respondWith(caches.match(externalUrl) 138 .then(cacheResponse => cacheResponse || fetch(externalUrl))); 139 return; 140 } 141 142 // If our if() condition is false, then this fetch handler won't 143 // intercept the request. If there are any other fetch handlers 144 // registered, they will get a chance to call event.respondWith(). 145 // If no fetch handlers call event.respondWith(), the request 146 // will be handled by the browser as if there were no service 147 // worker involvement. 148 }); 149
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.