1
0
forked from maik/IPFS-portal

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
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+6 -6
View File
@@ -10,21 +10,21 @@
"categories": ["utilities", "productivity"],
"icons": [
{
"src": "/icon-192.svg",
"src": "/icon-192.png",
"sizes": "192x192",
"type": "image/svg+xml",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "/icon-512.svg",
"src": "/icon-512.png",
"sizes": "512x512",
"type": "image/svg+xml",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "/icon-512.svg",
"src": "/icon-512.png",
"sizes": "512x512",
"type": "image/svg+xml",
"type": "image/png",
"purpose": "maskable"
}
]
+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));