From 46f4c1530e2931819deeb9889dea48775de4c3b4 Mon Sep 17 00:00:00 2001 From: Bircck <55695195+Bircck@users.noreply.github.com> Date: Tue, 6 Oct 2026 16:24:36 +0200 Subject: [PATCH 1/2] fix(website): stop runtime page cache from surviving redeployments Next.js 15.5.27 copies prerendered pages to .next/server/route-cache at runtime and serves that copy before the build's own output. In-place deployments keep these files, so after the next deployment pages reference static chunks that no longer exist and render blank. Disable writing the incremental cache to disk. --- Website/next.config.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Website/next.config.ts b/Website/next.config.ts index 4cda9348..b4094e3e 100644 --- a/Website/next.config.ts +++ b/Website/next.config.ts @@ -7,6 +7,11 @@ const nextConfig = { turbopack: { root: path.join(__dirname, '..'), }, + experimental: { + // Deployments overwrite the build in place. Pages cached on disk at runtime + // would survive the next deployment and reference static chunks that no longer exist. + isrFlushToDisk: false, + }, async headers() { return [ { From 9b8fc2f03d795fa570d1eb88c48eeb8f9559764d Mon Sep 17 00:00:00 2001 From: Bircck <55695195+Bircck@users.noreply.github.com> Date: Tue, 6 Oct 2026 16:35:01 +0200 Subject: [PATCH 2/2] fix(website): remove page cache left by earlier deployments on startup Sites already affected keep serving the stale copies even after the cache stops being written. Delete .next/server/route-cache when the Node.js server starts. --- Website/instrumentation.ts | 6 ++++++ Website/lib/removeStaleRouteCache.ts | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 Website/instrumentation.ts create mode 100644 Website/lib/removeStaleRouteCache.ts diff --git a/Website/instrumentation.ts b/Website/instrumentation.ts new file mode 100644 index 00000000..cd0b14da --- /dev/null +++ b/Website/instrumentation.ts @@ -0,0 +1,6 @@ +export async function register() { + if (process.env.NEXT_RUNTIME === 'nodejs') { + const { removeStaleRouteCache } = await import('./lib/removeStaleRouteCache'); + await removeStaleRouteCache(); + } +} diff --git a/Website/lib/removeStaleRouteCache.ts b/Website/lib/removeStaleRouteCache.ts new file mode 100644 index 00000000..f655bfd9 --- /dev/null +++ b/Website/lib/removeStaleRouteCache.ts @@ -0,0 +1,8 @@ +import { rm } from 'fs/promises'; +import path from 'path'; + +// Pages cached on disk by an earlier deployment take precedence over the current build +// and reference static chunks that no longer exist. Remove them before serving requests. +export async function removeStaleRouteCache() { + await rm(path.join(process.cwd(), '.next', 'server', 'route-cache'), { recursive: true, force: true }); +}