avoid caching initializing scan payloads
This commit is contained in:
@@ -72,8 +72,7 @@ export async function GET(req: NextRequest) {
|
|||||||
data,
|
data,
|
||||||
cachePolicy.responseCacheControl,
|
cachePolicy.responseCacheControl,
|
||||||
),
|
),
|
||||||
fetchCache:
|
fetchCache: "no-store",
|
||||||
cachePolicy.fetchMode === "no-store" ? "no-store" : undefined,
|
|
||||||
publicMessage: "Failed to fetch scan terminal data",
|
publicMessage: "Failed to fetch scan terminal data",
|
||||||
revalidateSeconds: cachePolicy.revalidateSeconds,
|
revalidateSeconds: cachePolicy.revalidateSeconds,
|
||||||
signal: controller.signal,
|
signal: controller.signal,
|
||||||
|
|||||||
@@ -77,6 +77,11 @@ export function runTests() {
|
|||||||
/cacheControlForData:\s*\(data\)\s*=>\s*buildScanTerminalResponseCacheControl/,
|
/cacheControlForData:\s*\(data\)\s*=>\s*buildScanTerminalResponseCacheControl/,
|
||||||
"scan terminal proxy must not CDN-cache failed, stale, or partial business payloads",
|
"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(
|
const scanTerminalClientSource = fs.readFileSync(
|
||||||
path.join(
|
path.join(
|
||||||
|
|||||||
Reference in New Issue
Block a user