From 13aa75c366af5803c916f9aacb02a977204ea415 Mon Sep 17 00:00:00 2001 From: Ajay Ghanwat Date: Mon, 3 Aug 2026 00:38:32 +0530 Subject: [PATCH] fix: rotate PWA cache and restrict runtime caching --- app/docs.test.ts | 2 ++ wrnexus.config.ts | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/app/docs.test.ts b/app/docs.test.ts index 4bc28d49..ddc5179b 100644 --- a/app/docs.test.ts +++ b/app/docs.test.ts @@ -135,6 +135,8 @@ test("site includes core guides and production configuration", () => { expect(config).toContain( '"style-src": ["\'self\'", "\'unsafe-inline\'", "https://fonts.googleapis.com"]', ); + expect(config).toContain('cacheName: "wrnexus-pwa-v2"'); + expect(config).toContain('pattern: "^https://wrnexusjs\\\\.dev/"'); }); test("language reference covers directives, events, loops, and conditionals", () => { diff --git a/wrnexus.config.ts b/wrnexus.config.ts index 8fa28d3e..040d25d9 100644 --- a/wrnexus.config.ts +++ b/wrnexus.config.ts @@ -15,6 +15,14 @@ const config: AppConfig = { pwa: { name: "WRNexusJS Documentation", shortName: "WRNexusJS Docs", + cacheName: "wrnexus-pwa-v2", + runtimeCaching: [ + { + pattern: "^https://wrnexusjs\\.dev/", + strategy: "network-first", + methods: ["GET"], + }, + ], display: "standalone", themeColor: "#6366f1", backgroundColor: "#0f172a",