Skip to content

Commit

Permalink
remove manual manifest caching
Browse files Browse the repository at this point in the history
  • Loading branch information
AjobK committed Sep 19, 2024
1 parent f805479 commit 938f838
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/service-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
// service worker, and the Workbox build step will be skipped.

import {clientsClaim} from 'workbox-core';
import {ExpirationPlugin} from 'workbox-expiration';
import {precacheAndRoute, createHandlerBoundToURL} from 'workbox-precaching';
import {registerRoute} from 'workbox-routing';
import {StaleWhileRevalidate} from 'workbox-strategies';

declare const self: ServiceWorkerGlobalScope;

Expand Down Expand Up @@ -53,19 +51,6 @@ registerRoute(
createHandlerBoundToURL(`${self.location.origin}/index.html`)
);

// Caches manifest as this is not done by default
registerRoute(
({url}) => url.origin === self.location.origin && url.pathname.endsWith('/manifest.json'),
new StaleWhileRevalidate({
cacheName: 'manifest-cache',
plugins: [
new ExpirationPlugin({
maxEntries: 1,
}),
],
})
);

// This allows the web app to trigger skipWaiting via
// registration.waiting.postMessage({type: 'SKIP_WAITING'})
self.addEventListener('message', event => {
Expand Down

0 comments on commit 938f838

Please sign in to comment.