fix: increase unfurl failure cache TTL from 1 day to 1 week
Build & Deploy / build-and-deploy (push) Successful in 1m56s
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:
@@ -5,7 +5,7 @@ import { createHash } from "crypto";
|
||||
|
||||
const CACHE_DIR = resolve(import.meta.dirname, "..", ".cache", "unfurl");
|
||||
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)";
|
||||
|
||||
// Concurrency limiter — prevents overwhelming outbound network
|
||||
|
||||
Reference in New Issue
Block a user