diff --git a/frontend/app/api/scan/terminal/route.ts b/frontend/app/api/scan/terminal/route.ts index 34e17ae8..2a0947ab 100644 --- a/frontend/app/api/scan/terminal/route.ts +++ b/frontend/app/api/scan/terminal/route.ts @@ -72,8 +72,7 @@ export async function GET(req: NextRequest) { data, cachePolicy.responseCacheControl, ), - fetchCache: - cachePolicy.fetchMode === "no-store" ? "no-store" : undefined, + fetchCache: "no-store", publicMessage: "Failed to fetch scan terminal data", revalidateSeconds: cachePolicy.revalidateSeconds, signal: controller.signal, diff --git a/frontend/components/dashboard/scan-terminal/__tests__/proxyCachePolicy.test.ts b/frontend/components/dashboard/scan-terminal/__tests__/proxyCachePolicy.test.ts index 3f888e90..b72d2885 100644 --- a/frontend/components/dashboard/scan-terminal/__tests__/proxyCachePolicy.test.ts +++ b/frontend/components/dashboard/scan-terminal/__tests__/proxyCachePolicy.test.ts @@ -77,6 +77,11 @@ export function runTests() { /cacheControlForData:\s*\(data\)\s*=>\s*buildScanTerminalResponseCacheControl/, "scan terminal proxy must not CDN-cache failed, stale, or partial business payloads", ); + assert.match( + scanTerminalProxySource, + /fetchCache:\s*"no-store"/, + "scan terminal proxy must not put failed or initializing payloads into the Next data cache", + ); const scanTerminalClientSource = fs.readFileSync( path.join(