Skip to content

Commit 6939bce

Browse files
Anna-Qvilscriptcoded
authored andcommitted
fix: prevent stale app-config.json with no-store and SW NetworkFirst
1 parent 01dd371 commit 6939bce

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/sw/sw.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ registerRoute(
102102
// /config.json and must be fresh when online.
103103
registerRoute(
104104
new Route(
105-
({ url }) => /^\/_services\/[^/]+\/app-config\.json$/.test(url.pathname),
105+
({ url }) =>
106+
url.pathname === "/app-config.json" ||
107+
/^\/_services\/[^/]+\/app-config\.json$/.test(url.pathname),
106108
new NetworkFirst({
107109
cacheName: "app-configs",
108110
fetchOptions: { cache: "no-store" },

0 commit comments

Comments
 (0)