Skip to content

Implement client-side record caching and request de-duplication #271

@rudokemper

Description

@rudokemper

Feature Request

Add client-side caching + request de-duping for record fetches to prevent repeated network calls across map clicks, gallery cards, and navigation. This improves perceived performance and reduces backend load.

User Stories & Acceptance Criteria

  • As a user interacting with multiple features, I don’t want the app to re-fetch the same record repeatedly.
    • AC: Client maintains a cache keyed by _id for raw records.
    • AC: In-flight requests for the same _id are de-duped (subsequent calls await the same promise).
    • AC: Cache invalidation strategy exists and is implemented (tied to what? Let's discuss. If we can't figure it out, mark as a TODO in the code).
    • AC: Client-side caching and request de-duping behavior is covered by tests, including:
      • cache hits return data without issuing a network request,
      • concurrent requests for the same _id are de-duped and resolve from a single in-flight fetch,
      • cache invalidation correctly triggers a refetch when conditions change,
      • all tests pass in CI.

Implementation Plan

(may be added later, before work begins)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions