avoid caching initializing scan payloads

This commit is contained in:
2569718930@qq.com
2026-06-10 19:49:27 +08:00
parent 25bd077b25
commit 05ec1fd993
2 changed files with 6 additions and 2 deletions
+1 -2
View File
@@ -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,
@@ -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(