Skip to content

feat: In-Memory TTL Cache Service for Horizon Responses (#196)#240

Merged
Sulex45 merged 2 commits into
stellarkit-lab-devtools:mainfrom
AnnabelJoe:feat/196-cache-service
Jun 8, 2026
Merged

feat: In-Memory TTL Cache Service for Horizon Responses (#196)#240
Sulex45 merged 2 commits into
stellarkit-lab-devtools:mainfrom
AnnabelJoe:feat/196-cache-service

Conversation

@AnnabelJoe

Copy link
Copy Markdown
Contributor

Build a centralised in-memory cache service that all routes can use to cache Horizon responses with configurable TTLs.

Changes:

  • Implemented CacheService in src/services/cache.js using node-cache
  • Applied caching to:
    • /network-status (5s TTL)
    • /fee-estimate (5s TTL)
    • /asset/:code/:issuer (30s TTL)
  • Added X-Cache: HIT/MISS headers
  • Implemented cache bypass via ?fresh=true
  • Added unit and integration tests

Closes #196

…ab-devtools#196)

Add a node-cache based service at src/services/cache.js and apply it to network-status, fee-estimate, and asset endpoints with configurable TTLs. Includes X-Cache headers, ?fresh=true bypass, and comprehensive tests.
@Sulex45

Sulex45 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Resolve Conflicts

@Sulex45 Sulex45 merged commit f91bf21 into stellarkit-lab-devtools:main Jun 8, 2026
0 of 3 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.

In-Memory TTL Cache Service for Horizon Responses

2 participants