Skip to content

perf: cursor-based event polling, Redis group state cache, and WebP images#949

Open
Markodiba wants to merge 2 commits into
Xoulomon:mainfrom
Markodiba:feat/performance-optimizations
Open

perf: cursor-based event polling, Redis group state cache, and WebP images#949
Markodiba wants to merge 2 commits into
Xoulomon:mainfrom
Markodiba:feat/performance-optimizations

Conversation

@Markodiba
Copy link
Copy Markdown
Contributor

@Markodiba Markodiba commented May 30, 2026

Summary

  • Soroban event polling (cursor pagination): Added SorobanEventCursor Prisma model to persist the last processed ledger and Horizon paging token across restarts. The poll loop now passes startLedger as an incremental fetch parameter at a fixed 5 s interval and calls GroupStateCache.invalidateContract() after each batch.
  • Redis group state cache: New GroupStateCache class in backend/src/lib/cache.ts wraps ioredis with a 10-second TTL and supports per-group and per-contract invalidation. Two Prometheus counters (cache_hits_total, cache_misses_total) with a cache="group_state" label are now exported on the /metrics endpoint.
  • Frontend image optimisation: Installed vite-imagetools and wired it into vite.config.ts. The error-page illustration is now served as WebP with a PNG fallback via a <picture> element and includes loading="lazy".

Test plan

Markodiba and others added 2 commits May 30, 2026 17:26
…mages

- Soroban event polling: persist cursor to new SorobanEventCursor DB model
  so restarts resume from the last processed ledger; use startLedger param
  for incremental fetches at a fixed 5 s interval; invalidate group state
  cache on every new event batch
- Redis group state cache: add GroupStateCache in backend/src/lib/cache.ts
  with 10 s TTL and per-contract bulk invalidation; expose cache_hits_total
  and cache_misses_total Prometheus counters on /metrics
- Image optimisation: install vite-imagetools, configure Vite plugin, serve
  something_went_wrong as WebP with PNG fallback via <picture>, add lazy loading

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@Markodiba 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant