From 79f2928172a31cb4e657e4ddfd2902b79f619be3 Mon Sep 17 00:00:00 2001 From: kuekhaoyang Date: Sun, 23 Nov 2025 18:31:27 +0800 Subject: [PATCH] feat: update service worker cache version and bypass proxy API routes --- public/sw.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(