diff --git a/frontend/components/dashboard/scan-terminal/__tests__/proxyCachePolicy.test.ts b/frontend/components/dashboard/scan-terminal/__tests__/proxyCachePolicy.test.ts index bdad23f0..eeb2d520 100644 --- a/frontend/components/dashboard/scan-terminal/__tests__/proxyCachePolicy.test.ts +++ b/frontend/components/dashboard/scan-terminal/__tests__/proxyCachePolicy.test.ts @@ -56,6 +56,16 @@ export function runTests() { /hasDirectBackendApiBaseUrl/, "public scan terminal requests should only attach user auth in direct-backend mode so CDN caches can be shared through the Next proxy", ); + assert.match( + scanTerminalClientSource, + /SCAN_TERMINAL_PAYLOAD_VERSION/, + "scan terminal client should include a stable payload version in the URL so CDN caches roll forward after response-shape optimizations", + ); + assert.match( + scanTerminalClientSource, + /params\.set\("_v",\s*SCAN_TERMINAL_PAYLOAD_VERSION\)/, + "scan terminal client should vary the CDN cache key without changing backend scan filters", + ); const overviewProxySource = fs.readFileSync( path.join( diff --git a/frontend/components/dashboard/scan-terminal/scan-terminal-client.ts b/frontend/components/dashboard/scan-terminal/scan-terminal-client.ts index c46bfcf9..c8846862 100644 --- a/frontend/components/dashboard/scan-terminal/scan-terminal-client.ts +++ b/frontend/components/dashboard/scan-terminal/scan-terminal-client.ts @@ -22,6 +22,7 @@ export const scanTerminalQueryPolicy = { autoRefreshMs: null, manualForceRefreshCooldownMs: 2 * 60_000, } as const; +const SCAN_TERMINAL_PAYLOAD_VERSION = "runway-slim-v1"; type TerminalQueryOptions = { forceRefresh?: boolean; @@ -142,6 +143,7 @@ async function getTerminal({ if (Number.isFinite(timezoneOffsetSeconds)) { params.set("timezone_offset_seconds", String(Math.trunc(Number(timezoneOffsetSeconds)))); } + params.set("_v", SCAN_TERMINAL_PAYLOAD_VERSION); if (forceRefresh) { params.set("_ts", String(Date.now())); }