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.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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/matblazor/dist/matblazor.css',
  38. '_content/matblazor/dist/matblazor.js',
  39. '_content/blazoranimate/blazoranimateinterop.js',
  40. '_content/blazoranimate/aos.css',
  41. '_framework/blazor.webassembly.js',
  42. '_framework/blazor.boot.json',
  43. '_framework/dotnet.5.0.7.js',
  44. 'https://fonts.googleapis.com/css?family=Roboto:300,400,500',
  45. 'https://fonts.googleapis.com/icon?family=Material+Icons',
  46. 'https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;700&display=swap',
  47. 'https://fonts.gstatic.com/s/ubuntu/v15/4iCs6KVjbNBYlgoKfw72nU6AFw.woff2',
  48. 'https://fonts.gstatic.com/s/roboto/v27/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2',
  49. 'https://fonts.gstatic.com/s/roboto/v27/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2',
  50. 'https://fonts.gstatic.com/s/materialicons/v85/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2',
  51. 'manifest.json'
  52. ];
  53. // install event
  54. self.addEventListener('install', evt => {
  55. evt.waitUntil(
  56. caches.open(staticCacheName).then(cache => {
  57. console.log('caching app assets');
  58. cache.addAll(assets);
  59. })
  60. );
  61. });
  62. // activate event
  63. self.addEventListener('activate', event => {
  64. //delete any caches that aren't in expectedCaches
  65. //which will get rid of site-static-v1
  66. event.waitUntil(
  67. caches.keys().then(keys => Promise.all(
  68. keys.map(key => {
  69. if (!staticCacheName.includes(key)) {
  70. return caches.delete(key);
  71. }
  72. })
  73. )).then(() => {
  74. console.log('Now ready to handle fetches!');
  75. })
  76. );
  77. });
  78. self.addEventListener('fetch', evt => {
  79. evt.respondWith(
  80. caches.match(evt.request).then(cacheRes => {
  81. return cacheRes || fetch(evt.request);
  82. })
  83. );
  84. });