forked from maik/IPFS-portal
fix: PWA icons, SW method guard, start script
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user