Skip to content

Commit

Permalink
network first for html
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardZaydler committed Oct 16, 2024
1 parent 87457bd commit a8c9478
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import { NetworkFirst } from "workbox-strategies";
import { registerRoute } from "workbox-routing";

precacheAndRoute(
self.__WB_MANIFEST.filter(
(entry) => !entry.url.includes("index.html") && !entry.url.includes("oauth")
)
self.__WB_MANIFEST.filter((entry) => !entry.url.includes("index.html" || "oauth"))
);
registerRoute(
({ request }) =>
request.mode === "navigate" ||
(request.headers.get("accept")?.includes("text/html") && !request.url.includes("oauth")),
(request.mode === "navigate" || request.headers.get("accept")?.includes("text/html")) &&
!request.url.includes("oauth"),

new NetworkFirst({
cacheName: "html-pages",
Expand Down

0 comments on commit a8c9478

Please sign in to comment.