Skip to content

Feat/290 last known good caching#301

Merged
Mosas2000 merged 20 commits intomainfrom
feat/290-last-known-good-caching
Mar 18, 2026
Merged

Feat/290 last known good caching#301
Mosas2000 merged 20 commits intomainfrom
feat/290-last-known-good-caching

Conversation

@Mosas2000
Copy link
Copy Markdown
Owner

Closes #292

Implement localStorage-based cache with TTL support for storing
successful API responses. Enables fallback to cached data when
live APIs are unavailable.

Includes metadata tracking for cache freshness and statistics.
Verify cache storage, retrieval, expiration, metadata tracking, and
statistics collection. Include edge cases for invalid entries,
storage errors, and lifecycle management.
Implement useCachedData hook that attempts live fetch with automatic
fallback to persistent cache on failure or timeout. Tracks data source
and freshness metadata for UI feedback.
Verify live fetch, cache storage, fallback behavior, timeout handling,
retry logic, and metadata tracking. Include edge cases for missing
cache and fetch errors.
Display visual indicator showing whether data is live or cached, with
timestamp showing when cached data was last updated. Includes retry
button for manual refresh when viewing cached data.
Prevent transactions when live data is unavailable or degraded.
Provides lockout status, reason, and severity level to inform UI
about why actions are disabled.
Verify lockout behavior for different data source states, messaging,
severity levels, and retry suggestions. Cover live, cached, and
unavailable scenarios.
Implement pattern-based and event-based cache invalidation.
Handles selective clearing of related caches when tips are sent,
profiles updated, or full refresh needed.
Verify pattern-based invalidation, event-triggered clearing, and
selective cache expiration. Cover tip-sent, profile-update, and
balance-change scenarios.
Wrap useCachedData for platform stats fetching with appropriate
TTL and timeout settings. Provides easy integration for stats
display components.
Document architecture, components, usage patterns, cache TTL guidelines,
invalidation triggers, visual feedback, best practices, testing approach,
and troubleshooting.
Wrap useCachedData for leaderboard fetching with appropriate TTL
and timeout. Provides easy integration for leaderboard view.
Envelope fetch calls with automatic response caching and fallback.
Supports per-endpoint TTL configuration. POST requests bypass cache.
Verify response caching, timeout handling, cache fallback,
POST bypass, TTL configuration, and error handling.
Provide global context for tracking connection status, API health,
and coordinating cache invalidation across all components.
Provide step-by-step instructions for integrating caching into
existing components. Include before/after examples, common patterns,
troubleshooting, and testing strategies.
Document new caching system, components, hooks, and documentation
added to improve resilience during API outages.
Document last-known-good caching system including persistent cache,
TTL management, automatic fallback, and global coordination layers.

References comprehensive caching guide for architecture and patterns.
Provide debug logging, cache operation tracking, and diagnostic
reporting for monitoring cache performance and detecting issues
in production.
Verify debug mode, operation logging, event logging, diagnostic
reporting, and JSON export functionality.
@Mosas2000 Mosas2000 merged commit 5bfa6c4 into main Mar 18, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce last-known-good caching for read-heavy surfaces during API instability

1 participant