Skip to content

Implement SDK caching layer with configurable TTL per method #365

Description

@Kingsman-99

Overview

Read-only SDK methods currently re-fetch from the RPC on every call. Add an in-memory caching layer with per-method TTL configuration to reduce redundant network requests.

Acceptance Criteria

  • StellarSplitSDK({ cache: { ttl: { getInvoice: 15000, getLeaderboard: 60000 } } }) config
  • Cache keyed by method name + serialised arguments
  • Stale entries evicted automatically when TTL expires
  • sdk.invalidateCache(method?, args?) manually evicts: all cache (no args), per method, or specific call
  • sdk.getCacheStats() returns { hits, misses, size, keys[] }
  • Cache disabled by default; opt-in via { cache: { enabled: true } }
  • Cache is per-SDK-instance — not shared across instances

Activity

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions