Skip to content

Optimise Horizon API calls with request batching and deduplication #174

@Marvell69

Description

@Marvell69

Multiple components on the same page often make identical Horizon API calls independently. Deduplicating and batching these calls reduces API load and improves page performance.

Requirements and context

  • Audit all Horizon API calls in the app
  • Implement request deduplication: identical in-flight requests share a single promise
  • Batch multiple address lookups (balance, federation) where Horizon supports it
  • Cache responses with appropriate TTLs (balances: 30s, federation: 10min, events: 60s)
  • Document expected API call reduction in PR

Suggested execution

git checkout -b perf/horizon-request-deduplication
  • Create src/lib/horizonClient.ts with deduplication and caching
  • Replace direct Horizon calls with the client
  • Write tests for deduplication and cache behaviour

Example commit message
perf: deduplicate and batch Horizon API calls across the app

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions