diff --git a/public/sw.js b/public/sw.js index 27efb1c..4617c4f 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1,4 +1,4 @@ -const CACHE_NAME = 'video-cache-v1'; +const CACHE_NAME = 'video-cache-v2'; self.addEventListener('install', (event) => { self.skipWaiting(); @@ -21,6 +21,11 @@ self.addEventListener('activate', (event) => { self.addEventListener('fetch', (event) => { const url = new URL(event.request.url); + // Skip proxy API routes - they handle their own caching and URL rewriting + if (url.pathname.startsWith('/api/proxy')) { + return; // Let the request pass through without Service Worker intervention + } + // Intercept HLS manifest files (.m3u8) if (url.pathname.endsWith('.m3u8')) { event.respondWith(