mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-14 16:23:43 +08:00
feat: update service worker cache version and bypass proxy API routes
This commit is contained in:
+6
-1
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user