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 3, 2024
1 parent 3c0a880 commit 68c4213
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions web/public/serviceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ console.log("Loading serviceWorker.js...");

import { precacheAndRoute } from "workbox-precaching";
import { registerRoute } from "workbox-routing";
import { NetworkFirst } from "workbox-strategies";
import { ExpirationPlugin } from "workbox-expiration";

self.skipWaiting();
// workbox.core.clientsClaim();
Expand Down Expand Up @@ -41,10 +43,10 @@ precacheAndRoute(self.__WB_MANIFEST);

function handleReports() {
console.log("Attempting to cache locations!");
return new strategies.NetworkFirst({
return new NetworkFirst({
cacheName: "api-location",
plugins: [
new expiration.ExpirationPlugin({
new ExpirationPlugin({
maxEntries: 16,
maxAgeSeconds: 120,
}),
Expand Down

0 comments on commit 68c4213

Please sign in to comment.