From a508052ff8deaa408ae8eb36f857bed9d3a64043 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Sat, 5 Sep 2026 11:22:04 -0400 Subject: [PATCH] confessional speedup, part four and a half: let the cache breathe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A sixty-second feed-cache TTL misses almost every real visit — readers arrive minutes apart. Invalidation is already exact for every mutation in this process; the TTL only bounds a renamed handle lingering on old asks, so ten minutes is the right trade. Claude-Session: https://claude.ai/code/session_01FryvSZ4bmGcpc7q13FNaCj --- system/netlify/functions/sotce-net.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/netlify/functions/sotce-net.mjs b/system/netlify/functions/sotce-net.mjs index f3d777ba5e..98f76fedf9 100644 --- a/system/netlify/functions/sotce-net.mjs +++ b/system/netlify/functions/sotce-net.mjs @@ -117,9 +117,10 @@ const SHELL_MODIFIED_HTTP = SHELL_MODIFIED.toUTCString(); // assembly is dominated by per-asker handle lookups that can each cost two // Auth0 round-trips. Cache it in-process: every mutation to pages or asks // flows through this same long-lived process, so invalidation is exact; the -// TTL only bounds staleness from out-of-module writes (e.g. /handle changes). +// TTL only bounds staleness from out-of-module writes (a /handle rename +// showing its old name on old asks for a few minutes is the worst case). let feedCache = null; // { at, data: { pages, questions, totalPages, totalQuestions, lastModified, hasMore } } -const FEED_CACHE_TTL = 60 * 1000; +const FEED_CACHE_TTL = 10 * 60 * 1000; function invalidateFeedCache() { feedCache = null; } -- 2.51.2