From e987c8b37ac695f4bba032ca4dcc8cfdc2612a19 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Wed, 19 Nov 2025 18:01:21 +0530 Subject: [PATCH] chore(pwa): get rid of public headers requests (#2477) --- apps/readest-app/next.config.mjs | 10 ++++++++++ apps/readest-app/public/_headers | 2 -- 2 files changed, 10 insertions(+), 2 deletions(-) delete mode 100644 apps/readest-app/public/_headers diff --git a/apps/readest-app/next.config.mjs b/apps/readest-app/next.config.mjs index c995aa3e..12856f2f 100644 --- a/apps/readest-app/next.config.mjs +++ b/apps/readest-app/next.config.mjs @@ -50,6 +50,15 @@ const nextConfig = { }, ], }, + { + source: '/_next/static/:path*', + headers: [ + { + key: 'Cache-Control', + value: 'public, max-age=31536000, immutable', + }, + ], + }, ]; }, }; @@ -57,6 +66,7 @@ const nextConfig = { const withPWA = withPWAInit({ dest: 'public', disable: isDev || appPlatform !== 'web', + buildExcludes: [/\/_headers$/], cacheOnFrontEndNav: true, aggressiveFrontEndNavCaching: true, reloadOnOnline: true, diff --git a/apps/readest-app/public/_headers b/apps/readest-app/public/_headers deleted file mode 100644 index e6320ab1..00000000 --- a/apps/readest-app/public/_headers +++ /dev/null @@ -1,2 +0,0 @@ -/_next/static/* - Cache-Control: public,max-age=31536000,immutable \ No newline at end of file