Skip to content

Commit

Permalink
add root path in workbox strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-jonghoonpark committed Oct 19, 2023
1 parent d501987 commit aca4adc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ workbox.clientsClaim();
// let Workbox handle our precache list
workbox.precaching.precacheAndRoute(self.__precacheManifest);

// use `NetworkFirst` strategy for root page
workbox.routing.registerRoute(
/^\/$/,
new workbox.strategies.NetworkFirst()
);

// use `NetworkFirst` strategy for html
workbox.routing.registerRoute(
/\.html$/,
Expand Down

0 comments on commit aca4adc

Please sign in to comment.