From fa5f5ce07b95da8cfa123a4a1445c956c063242c Mon Sep 17 00:00:00 2001 From: Tao Zhou Date: Tue, 13 Feb 2024 10:05:26 -0800 Subject: [PATCH] feat: mark precache requests as low priority --- packages/workbox-precaching/src/PrecacheController.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/workbox-precaching/src/PrecacheController.ts b/packages/workbox-precaching/src/PrecacheController.ts index bb7f97e59..9d933e3d9 100644 --- a/packages/workbox-precaching/src/PrecacheController.ts +++ b/packages/workbox-precaching/src/PrecacheController.ts @@ -30,6 +30,11 @@ declare global { interface ServiceWorkerGlobalScope { __WB_MANIFEST: Array; } + + // https://caniuse.com/?search=Request.init%20priority + interface RequestInit { + priority?: 'low' | 'normal' | 'high'; + } } interface PrecacheControllerOptions { @@ -213,6 +218,7 @@ class PrecacheController { integrity, cache: cacheMode, credentials: 'same-origin', + priority: 'low', }); await Promise.all(