PWA Fundvelo der Caritas.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

service-worker.js 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. // In development, always fetch from the network and do not enable offline support.
  2. // This is because caching would make development more difficult (changes would not
  3. // be reflected on the first load after each change).
  4. const staticCacheName = 'site-static-v1';
  5. const assets = [
  6. '/',
  7. '/index.html',
  8. '/account',
  9. '/account/Found',
  10. '/account/Missing',
  11. '/info',
  12. '/caritas_services',
  13. '/lost_found',
  14. '/keydata',
  15. '/keydata/Found',
  16. '/keydata/Missing',
  17. '/conclusion_found',
  18. '/conclusion_missing',
  19. '/doneimage',
  20. 'favicon.ico',
  21. 'images/batch_found.png',
  22. 'images/batch_fundvelo.png',
  23. 'images/batch_kulturlegi.png',
  24. 'images/batch_markt.png',
  25. 'images/batch_missing.png',
  26. 'images/caritas_logo.png',
  27. 'images/integrate_logo.png',
  28. 'images/done.png',
  29. 'images/icon_camera.png',
  30. 'images/icon_driveupload.png',
  31. 'images/icon_location.png',
  32. 'icons/icon-144.png',
  33. 'css/app.css',
  34. 'css/united/bootstrap.min.css',
  35. 'css/united/_bootswatch.min.css',
  36. 'css/united/_variables.min.css',
  37. '_content/BlazorColorPicker/colorpicker.css',
  38. '_content/BlazorColorPicker/colorpicker.js',
  39. '_content/MatBlazor/dist/matBlazor.css',
  40. '_content/MatBlazor/dist/matBlazor.js',
  41. '_content/BlazorAnimate/blazorAnimateInterop.js',
  42. '_content/BlazorAnimate/aos.css',
  43. '_framework/blazor.webassembly.js',
  44. '_framework/blazor.boot.json',
  45. '_framework/wasm/dotnet.3.2.0.js',
  46. 'https://fonts.googleapis.com/css?family=Roboto:300,400,500',
  47. 'https://fonts.googleapis.com/icon?family=Material+Icons',
  48. 'https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;700&display=swap',
  49. 'https://fonts.gstatic.com/s/ubuntu/v15/4iCs6KVjbNBYlgoKfw72nU6AFw.woff2',
  50. 'https://fonts.gstatic.com/s/roboto/v27/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2',
  51. 'https://fonts.gstatic.com/s/roboto/v27/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2',
  52. 'https://fonts.gstatic.com/s/materialicons/v85/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2',
  53. 'manifest.json'
  54. ];
  55. // install event
  56. self.addEventListener('install', evt => {
  57. evt.waitUntil(
  58. caches.open(staticCacheName).then(cache => {
  59. console.log('caching app assets');
  60. cache.addAll(assets);
  61. })
  62. );
  63. });
  64. // activate event
  65. self.addEventListener('activate', evt => {
  66. evt.waitUntil(
  67. caches.keys().then(keys => {
  68. return Promise.all(keys
  69. .filter(key => key !== staticCacheName)
  70. .map(key => caches.delete())
  71. )
  72. })
  73. );
  74. });
  75. self.addEventListener('fetch', evt => {
  76. evt.respondWith(
  77. caches.match(evt.request).then(cacheRes => {
  78. return cacheRes || fetch(evt.request);
  79. })
  80. );
  81. });