fix: PWA icons, SW method guard, start script

This commit is contained in:
maikrolf
2026-07-02 00:59:44 +02:00
parent a13e614371
commit 9b8b382925
5 changed files with 14 additions and 7 deletions
+5
View File
@@ -74,6 +74,11 @@ self.addEventListener('fetch', (event) => {
// Same-origin only
if (url.origin !== self.location.origin) return;
// Only cache GET/HEAD — POST/PUT/DELETE/OPTIONS can't use Cache API
if (request.method !== 'GET' && request.method !== 'HEAD') {
return; // pass through, no caching
}
// 1. Static assets → cache-first
if (isStaticAsset(url)) {
event.respondWith(cacheFirst(request, STATIC_CACHE));