fix: increase unfurl failure cache TTL from 1 day to 1 week
Build & Deploy / build-and-deploy (push) Successful in 1m56s

YouTube and other bot-blocked sites permanently fail unfurl requests.
With a 24h failure cache, every daily build re-attempts ~16+ URLs at
22s timeout each, adding 70+ seconds to deploy time.
Matching failure TTL to success TTL (7 days) eliminates this.
This commit is contained in:
svemagie
2026-04-22 19:08:03 +02:00
parent 3d8a057d54
commit e82f5aab23
+1 -1
View File
@@ -5,7 +5,7 @@ import { createHash } from "crypto";
const CACHE_DIR = resolve(import.meta.dirname, "..", ".cache", "unfurl"); const CACHE_DIR = resolve(import.meta.dirname, "..", ".cache", "unfurl");
const CACHE_DURATION_MS = 7 * 24 * 60 * 60 * 1000; // 1 week const CACHE_DURATION_MS = 7 * 24 * 60 * 60 * 1000; // 1 week
const FAILURE_CACHE_MS = 24 * 60 * 60 * 1000; // 1 day for failed fetches const FAILURE_CACHE_MS = 7 * 24 * 60 * 60 * 1000; // 1 week — YouTube/bot-blocked sites never succeed, no point retrying daily
const USER_AGENT = "Mozilla/5.0 (compatible; Indiekit/1.0; +https://getindiekit.com)"; const USER_AGENT = "Mozilla/5.0 (compatible; Indiekit/1.0; +https://getindiekit.com)";
// Concurrency limiter — prevents overwhelming outbound network // Concurrency limiter — prevents overwhelming outbound network