From c55783a0c941367ca7674e7020eb44f804fb8cbb Mon Sep 17 00:00:00 2001 From: Daniel Kronovet Date: Thu, 19 Mar 2026 14:03:56 -0400 Subject: [PATCH] Increase cache TTLs for entries and Discord profiles. Jam slugs and Discord profiles now cache for 24 hours (rarely change between deploys). Active jam entries cache for 1 hour to pick up new submissions during jam periods. Archived entries remain at 7 days. Co-Authored-By: Claude Haiku 4.5 --- backend/src/services/discord.ts | 2 +- backend/src/services/entries.ts | 4 ++-- spec/JUDGING.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/services/discord.ts b/backend/src/services/discord.ts index a2107fc..bf581fb 100644 --- a/backend/src/services/discord.ts +++ b/backend/src/services/discord.ts @@ -14,7 +14,7 @@ interface CacheEntry { expiresAt: number; } -const CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes +const CACHE_TTL_MS = 24 * 60 * 60 * 1000; // 24 hours const cache = new Map(); function getBotToken(): string | undefined { diff --git a/backend/src/services/entries.ts b/backend/src/services/entries.ts index 25297f8..6118bc8 100644 --- a/backend/src/services/entries.ts +++ b/backend/src/services/entries.ts @@ -120,8 +120,8 @@ async function fetchEntriesFromGitHub(jamSlug: string): Promise { // In-memory cache for GitHub-fetched entries const entriesCache: Map = new Map(); -const CACHE_TTL = 5 * 60 * 1000; // 5 minutes (slugs, frontmatter) -const CACHE_TTL_ACTIVE = 5 * 60 * 1000; // 5 minutes for latest jam entries +const CACHE_TTL = 24 * 60 * 60 * 1000; // 24 hours (slugs, frontmatter) +const CACHE_TTL_ACTIVE = 60 * 60 * 1000; // 1 hour for latest jam entries const CACHE_TTL_ARCHIVE = 7 * 24 * 60 * 60 * 1000; // 7 days for older jam entries /** Latest jam slug, updated by getJamSlugs(). */ diff --git a/spec/JUDGING.md b/spec/JUDGING.md index 8a61999..cccd529 100644 --- a/spec/JUDGING.md +++ b/spec/JUDGING.md @@ -126,7 +126,7 @@ Backend fetches entries from GitHub: https://raw.githubusercontent.com/dojoengine/game-jams/main/{slug}/entries.yaml ``` -Caching: 5-minute TTL in memory. This balances freshness with minimal GitHub API calls. +Caching: 1-hour TTL in memory. This balances freshness with minimal GitHub API calls. ## Pairwise Judging