PWA: manifest.json, Service Worker, Meta-Tags und README-Hinweis hinzugefügt

This commit is contained in:
2025-07-23 18:06:23 +02:00
parent 4c5371c07f
commit 9a57955902
4 changed files with 49 additions and 0 deletions

20
static/service-worker.js Normal file
View File

@@ -0,0 +1,20 @@
const CACHE_NAME = 'datumsrechner-cache-v1';
const urlsToCache = [
'/',
'/static/style.css',
'/favicon.ico',
'/favicon.png',
'/logo.svg',
];
self.addEventListener('install', event => {
event.waitUntil(
caches.open(CACHE_NAME)
.then(cache => cache.addAll(urlsToCache))
);
});
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request)
.then(response => response || fetch(event.request))
);
});