feat: dontStoreInCache

This commit is contained in:
Gergő Móricz 2025-05-29 15:23:24 +02:00
parent 853ff1875c
commit 5b0f2da02f
2 changed files with 3 additions and 1 deletions

View File

@ -310,6 +310,7 @@ const baseScrapeOptions = z
blockAds: z.boolean().default(true),
proxy: z.enum(["basic", "stealth", "auto"]).optional(),
maxAge: z.number().int().gte(0).safe().default(0),
dontStoreInCache: z.boolean().default(false),
})
.strict(strictMessage);

View File

@ -6,7 +6,8 @@ import { EngineError, IndexMissError } from "../../error";
import crypto from "crypto";
export async function sendDocumentToIndex(meta: Meta, document: Document) {
const shouldCache = meta.winnerEngine !== "cache"
const shouldCache = !meta.options.dontStoreInCache
&& meta.winnerEngine !== "cache"
&& meta.winnerEngine !== "index"
&& meta.winnerEngine !== "index;documents"
&& !meta.featureFlags.has("actions")