Skip to content

feat: build cache priming job#422

Merged
Mosas2000 merged 2 commits intoStellaBridge:mainfrom
AbuJulaybeeb:feature/backend-cache-primer
Apr 29, 2026
Merged

feat: build cache priming job#422
Mosas2000 merged 2 commits intoStellaBridge:mainfrom
AbuJulaybeeb:feature/backend-cache-primer

Conversation

@AbuJulaybeeb
Copy link
Copy Markdown
Contributor

This PR implements a comprehensive cache priming system to eliminate "cold-start" latency for critical dashboard components.

Key Features:

Intelligent Priming: Categorizes tasks into High and Low priority to balance refresh frequency with external API rate limits.
Startup Warming: Automatically triggers high-priority priming (Protocol Stats, Major Prices) when the server starts.
Scheduled Refresh: Hourly and daily background jobs ensure cache entries stay fresh without waiting for user requests.
Robustness: Implements a partial-fill strategy where failed tasks are isolated and recorded without crashing the entire priming cycle.
Observability: New Prometheus metrics track priming success rates and execution duration.
Technical Changes:

New Service: CachePrimerService for orchestrating multi-priority priming.
New Job Processor: processCachePriming for BullMQ integration.
Updated MetricsService with priming-specific counters and histograms.
Refactored legacy cacheWarming.ts into a modern CLI tool utilizing the new service.
Closes #381

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 29, 2026

@AbuJulaybeeb Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Mosas2000
Copy link
Copy Markdown
Contributor

Resolve conflicts

@Mosas2000 Mosas2000 merged commit ee6e9f7 into StellaBridge:main Apr 29, 2026
12 of 15 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.

Build Cache Priming Job

2 participants