Skip to content

Add stale-while-revalidate caching to the investor portfolio query for instant repeat visits #34

Description

@Chucks1093

Summary

The investor portfolio query refetches on every visit, showing a spinner even when the data has not changed. Setting a staleTime should serve the cached portfolio instantly and revalidate in the background so the page feels responsive on repeat visits.

Scope

  • Set staleTime to 60 seconds on the investor portfolio query
  • Serve cached positions immediately on repeat visits without a spinner
  • Show a subtle 'Refreshing…' indicator only when a background refetch is in progress
  • Invalidate the cache immediately after a new investment is confirmed
  • Confirm stale data is not served if the user has been away for more than 60 seconds

Acceptance Criteria

  • Cached portfolio shown instantly on repeat visits within 60 seconds
  • Background refetch indicator visible during revalidation
  • Cache invalidated after a confirmed investment
  • Spinner not shown when serving a fresh cached response

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions