mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #440] perf: TTL-based eviction sweep for prefetch cache #96
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#96
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Divkix on GitHub (Mar 11, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/440
Problem
The prefetch cache in
navigation.tsstores RSC prefetch responses with a 30s TTL and a hard cap of 50 entries. Expired entries are only cleaned on individual access or displaced by FIFO when at capacity. This means expired entries waste slots, causing premature eviction of still-valid entries on link-heavy pages.Solution
Sweep all expired entries before resorting to FIFO eviction in
storePrefetchResponse(). This ensures fresh entries survive longer under pressure without increasing the cache size cap.Implementation
PR: #434