// In development, always fetch from the network and do not enable offline support. // This is because caching would make development more difficult (changes would not // be reflected on the first load after each change). const staticCacheName = 'site-static-v1'; const assets = [ '/', '/index.html', '/account', '/account/Found', '/account/Missing', '/info', '/caritas_services', '/lost_found', '/keydata', '/keydata/Found', '/keydata/Missing', '/conclusion_found', '/conclusion_missing', '/doneimage', 'favicon.ico', 'images/batch_found.png', 'images/batch_fundvelo.png', 'images/batch_kulturlegi.png', 'images/batch_markt.png', 'images/batch_missing.png', 'images/caritas_logo.png', 'images/integrate_logo.png', 'images/done.png', 'images/icon_camera.png', 'images/icon_driveupload.png', 'images/icon_location.png', 'icons/icon-144.png', 'css/app.css', 'css/united/bootstrap.min.css', 'css/united/_bootswatch.min.css', 'css/united/_variables.min.css', '_content/BlazorColorPicker/colorpicker.css', '_content/BlazorColorPicker/colorpicker.js', '_content/MatBlazor/dist/matBlazor.css', '_content/MatBlazor/dist/matBlazor.js', '_content/BlazorAnimate/blazorAnimateInterop.js', '_content/BlazorAnimate/aos.css', '_framework/blazor.webassembly.js', '_framework/blazor.boot.json', '_framework/wasm/dotnet.3.2.0.js', 'https://fonts.googleapis.com/css?family=Roboto:300,400,500', 'https://fonts.googleapis.com/icon?family=Material+Icons', 'https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;700&display=swap', 'https://fonts.gstatic.com/s/ubuntu/v15/4iCs6KVjbNBYlgoKfw72nU6AFw.woff2', 'https://fonts.gstatic.com/s/roboto/v27/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2', 'https://fonts.gstatic.com/s/roboto/v27/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2', 'https://fonts.gstatic.com/s/materialicons/v85/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2', 'manifest.json' ]; // install event self.addEventListener('install', evt => { evt.waitUntil( caches.open(staticCacheName).then(cache => { console.log('caching app assets'); cache.addAll(assets); }) ); }); // activate event self.addEventListener('activate', evt => { evt.waitUntil( caches.keys().then(keys => { return Promise.all(keys .filter(key => key !== staticCacheName) .map(key => caches.delete()) ) }) ); }); self.addEventListener('fetch', evt => { evt.respondWith( caches.match(evt.request).then(cacheRes => { return cacheRes || fetch(evt.request); }) ); });