Skip to content

perf(frontend): add client-side query cache for API data #32

Description

@Flickwire-Agent

Summary

Add a small query cache/SWR layer for repeated page data fetches.

Evidence

  • Pages manage fetch state locally: apps/web/src/components/OpportunitiesPage.tsx:57, apps/web/src/components/BargainsPage.tsx:27, apps/web/src/components/ListingsPage.tsx:32, and apps/web/src/components/ItemPage.tsx:27.
  • Backend cache cadence is usually 15 minutes.

Expected Impact

Medium. Improves back/forward navigation and reduces duplicate network requests.

Implementation Notes

Use a lightweight custom cache or a library. Set stale time to match backend refresh for cache-backed endpoints.

Acceptance Criteria

  • Route revisits can show cached data immediately.
  • Stale data refreshes in the background where appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: frontendFrontend/UI workperformancePerformance and optimization workpoints: 5Estimated effort: 5 story pointspriority: mediumMedium-impact optimizationsprint: backlogReady for future sprint planning

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions