Skip to content

perf: TTL-based eviction sweep for prefetch cache #440

@Divkix

Description

@Divkix

Problem

The prefetch cache in navigation.ts stores 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions