diff --git a/public/icon-192.png b/public/icon-192.png new file mode 100644 index 0000000..58b71b9 Binary files /dev/null and b/public/icon-192.png differ diff --git a/public/icon-512.png b/public/icon-512.png new file mode 100644 index 0000000..975906e Binary files /dev/null and b/public/icon-512.png differ diff --git a/public/manifest.json b/public/manifest.json index 4beba6e..b532d3f 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -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" } ] diff --git a/public/sw.js b/public/sw.js index caff2c4..a22311f 100644 --- a/public/sw.js +++ b/public/sw.js @@ -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)); diff --git a/start-pm2.sh b/start-pm2.sh index 684553f..914c56a 100644 --- a/start-pm2.sh +++ b/start-pm2.sh @@ -8,4 +8,6 @@ npm install echo "=== npm run build ===" npm run build echo "=== next start port ${PORT:=3005} ===" -exec npx next start --port "$PORT" +# Consume any extra args PM2 passes (e.g. --port=3005) +shift "$(($# < 1 ? 0 : 1))" 2>/dev/null || true +exec npx next start --port "$PORT" "$@"