Fix: Admin-Endpoints umgehen SW-Timeout — kein 'Offline' bei langen Jobs (SW by-v940)

This commit is contained in:
rene 2026-05-14 13:08:52 +02:00
parent 163a6ff6a5
commit 60e5c9ba35
3 changed files with 5 additions and 3 deletions

View file

@ -3,7 +3,7 @@
Offline-Cache + Push Notifications + Tile-Cache
============================================================ */
const CACHE_VERSION = 'by-v939';
const CACHE_VERSION = 'by-v940';
const CACHE_STATIC = `${CACHE_VERSION}-static`;
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
@ -238,6 +238,8 @@ self.addEventListener('fetch', event => {
// Media-Uploads + KI-Endpoints: direkt ans Netzwerk — kein Clone, kein Timeout, kein Queue
// KI-Anfragen ans lokale LLM können mehrere Minuten dauern
if (method === 'POST' && (_isMediaUpload(event.request) || url.pathname.startsWith('/api/ki/') || url.pathname.includes('/health/ki-') || url.pathname.includes('/health/symptom'))) return;
// Admin-Endpoints: kein SW-Timeout, direkt ans Netzwerk
if (url.pathname.startsWith('/api/admin/')) return;
// Mutationen (POST/PATCH/PUT/DELETE): mit Timeout, bei Offline → Queue
if (['POST', 'PATCH', 'PUT', 'DELETE'].includes(method)) {