Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/routes/adl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ export function adlRoutes(): Hono {
// Check cache to avoid redundant expensive RPC calls
const cached = adlCache.get(slab);
if (cached && Date.now() - cached.fetchedAt < ADL_CACHE_TTL_MS) {
// Promote to most-recently-used so the FIFO-by-insertion eviction
// at lines below behaves as LRU. Without this, hot keys inserted
// early get evicted while cold keys inserted later survive.
adlCache.delete(slab);
adlCache.set(slab, cached);
return c.json(cached.data, 200, { "X-Cache": "HIT" });
}

Expand Down