Skip to content

Commit

Permalink
Update serviceWorker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
datajohnson committed Jul 30, 2024
1 parent b0de2e1 commit 8bf08b4
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions web/public/serviceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,11 @@ self.skipWaiting();
precacheAndRoute(self.__WB_MANIFEST);

// Works if app is a single page app
registerRoute(new NavigationRoute(createHandlerBoundToURL("/index.html")));

// Example cache GET req (import removed)
// workbox.routing.registerRoute(({ url }) => {
// return url.pathname.startsWith('/node_modules/');
// },
// new strategies.CacheFirst({
// cacheName: 'node-module-cache',
// plugins: [
// new expiration.ExpirationPlugin({
// maxEntries: 255,
// maxAgeSeconds: 60 * 60 * 24 * 30,
// }),
// ],
// })
// );

/*
* Attempt to cache simple api calls
*/
registerRoute(
new NavigationRoute(createHandlerBoundToURL("/index.html"), {
denylist: [new RegExp(/^\/api/), new RegExp(/^\/migrate/)],
})
);

// Cache fonts
registerRoute(
Expand Down

0 comments on commit 8bf08b4

Please sign in to comment.