From 3fb0a3bae95965330e21a3695d9fc447b11ccf0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Thu, 14 Nov 2024 00:51:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20PWA=20=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E6=9C=89=E5=AF=86=E7=A0=81=E6=97=B6=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaomusic/static/sw.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/xiaomusic/static/sw.js b/xiaomusic/static/sw.js index 8392fc4..18010bf 100644 --- a/xiaomusic/static/sw.js +++ b/xiaomusic/static/sw.js @@ -22,7 +22,6 @@ self.addEventListener('install', function(e) { }) self.addEventListener('activate', function(e) { - // 判断地址是不是需要实时去请求,是就继续发送请求 console.log('Activate event') e.waitUntil( Promise.all( @@ -40,16 +39,3 @@ self.addEventListener('activate', function(e) { ) }) -self.addEventListener('fetch', function(e) { - // 匹配到缓存资源,就从缓存中返回数据 - e.respondWith( - caches.match(e.request).then(function(response) { - if (response != null) { - console.log('Using cache for:', e.request.url) - return response - } - console.log('Fallback to fetch:', e.request.url) - return fetch(e.request.url) - }) - ) -})