From e82f5aab23588bae2ef5192feddf310f268fa899 Mon Sep 17 00:00:00 2001 From: svemagie Date: Wed, 22 Apr 2026 19:08:03 +0200 Subject: [PATCH] fix: increase unfurl failure cache TTL from 1 day to 1 week 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. --- lib/unfurl-shortcode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/unfurl-shortcode.js b/lib/unfurl-shortcode.js index e9f6dea..67dac41 100644 --- a/lib/unfurl-shortcode.js +++ b/lib/unfurl-shortcode.js @@ -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