Skip to content

Commit

Permalink
Merge pull request #31 from icefoganalytics/main
Browse files Browse the repository at this point in the history
Update serviceWorker.js
  • Loading branch information
datajohnson authored Jul 30, 2024
2 parents 978ed57 + 8bf08b4 commit c865f7e
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 c865f7e

Please sign in to comment.