Cache Strategy
Blocklight uses in-memory caching with configurable TTLs:- Contracts: 1 hour TTL (default) - bytecode is immutable, so long cache is safe
- Transactions: 5 minutes TTL (default) - recent transaction data
Configuration
Configure cache TTLs inconfig.yaml:
Performance Impact
Caching significantly reduces RPC calls and improves latency:- Contract bytecode: Cached aggressively since contracts are immutable
- Transaction receipts: Cached for 5 minutes to balance freshness and performance
- Cache hit rates: Typically 85-95% for contracts in production