Add explaining comment

This commit is contained in:
RMidhunSuresh 2021-11-09 15:39:24 +05:30
parent 57e2c4ea45
commit 8fba3f4ca9

View file

@ -69,6 +69,11 @@ async function purgeOldCaches() {
} }
self.addEventListener('fetch', (event) => { self.addEventListener('fetch', (event) => {
/*
service worker shouldn't handle xhr uploads because otherwise
the progress events won't fire.
This has to do with xhr not being supported in service workers.
*/
if (event.request.method === "GET") { if (event.request.method === "GET") {
event.respondWith(handleRequest(event.request)); event.respondWith(handleRequest(event.request));
} }