diff --git a/src/Client/wwwroot/service-worker.published.js b/src/Client/wwwroot/service-worker.published.js index c9b59e4..9a2affb 100644 --- a/src/Client/wwwroot/service-worker.published.js +++ b/src/Client/wwwroot/service-worker.published.js @@ -14,6 +14,9 @@ const offlineAssetsExclude = [ /^service-worker\.js$/ ]; async function onInstall(event) { console.info('Service worker: Install'); + // Activate the new service worker as soon as the old one is retired. + self.skipWaiting(); + // Fetch and cache all matching items from the assets manifest const assetsRequests = self.assetsManifest.assets .filter(asset => offlineAssetsInclude.some(pattern => pattern.test(asset.url)))