NodeCache EVM
← Back to blog

Custom RPC Cache vs Managed Service for Redundant EVM Read Calls

Custom RPC Cache vs Managed Service for Redundant EVM Read Calls
Photo by Kevin Ache on Unsplash

October 27, 2026

When evaluating a custom rpc cache vs managed service, developers compare writing self-hosted Redis middleware against using an infrastructure endpoint to stop paying for duplicate reads. An application or indexer often fetches identical data across rapid cycles, driving unnecessary RPC consumption. Choosing between maintaining an in-house caching proxy or using an external read-layer service determines where caching complexity lives.

Why Ethereum Backends Repeatedly Query Unchanged State

Backend services and decentralized application frontends continuously send read-only JSON-RPC requests across the network to providers like Infura or Alchemy. Ethereum developers pay for the same repeated read-only RPC calls — eth_call, eth_getBalance, eth_getLogs — over and over against their provider, driving up cost and rate-limit throttling, with no caching layer sitting in front of the endpoint to catch requests for data that hasn't changed.

This pattern emerges naturally from how modern decentralized services operate. Polling loops run on fixed timer intervals to verify account balances (eth_getBalance) for active sessions or monitor worker wallets. Smart contract read operations (eth_call) query view methods, such as token decimals, total supply figures, user permissions, or oracle prices, even when state remains unchanged over dozens of blocks. Indexers and analytics pipelines frequently issue historical log scans (eth_getLogs) across overlapping block ranges or make multiple queries for the latest block height (eth_blockNumber) across distributed tasks.

Each invocation of these read-only calls travels upstream as an isolated network request. Because default provider configurations treat every inbound payload independently, duplicate requests consume upstream compute credits and trigger per-second or per-minute rate limits.

Analysis: The Cost and Rate-Limit Mechanics of Scaling Uncached Reads

As application traffic expands, read volume scales with user activity and worker count rather than with the actual frequency of Ethereum state transitions. An application serving multiple simultaneous users might query the exact same ERC-20 contract balance or read the exact same contract parameters dozens of times in the span of a single block interval.

On Ethereum mainnet, new blocks arrive approximately every twelve seconds. Data retrieved via state-dependent methods cannot change between block arrivals unless an included transaction updates that specific storage slot. When an application queries eth_call for a static view function ten times within two seconds, nine of those requests return bytes identical to the first. Similarly, querying eth_chainId repeatedly produces an identical chain identifier across the lifetime of the application.

Without an intermediary caching layer, costs and rate limits scale linearly with raw request throughput. When rate limits hit, providers return HTTP 429 status codes or JSON-RPC error responses, requiring backoff routines that degrade frontend interfaces and delay indexer ingestion.

Building an in-house proxy requires provisioning caching infrastructure such as Redis, writing serialization middleware to handle raw JSON-RPC requests, parsing hexadecimal parameters, keying requests by hash, and maintaining high-availability servers. Teams must continuously monitor memory pressure, evictions, and upstream failovers.

How an RPC Caching Layer Operates

A JSON-RPC caching proxy intercepts inbound JSON-RPC POST requests between client applications and the upstream node provider. When a request arrives, the proxy reads the method and the parameter array:

  1. The proxy computes a deterministic cache key derived from the JSON-RPC method and the serialized params array.
  2. If an entry exists for that specific key and remains unexpired, the proxy immediately returns the stored JSON-RPC result object without contacting the upstream provider.
  3. If no cached record exists, the proxy forwards the request upstream to the provider, stores the returned result payload under the computed key alongside a time-to-live timer, and returns the response to the caller.

By intercepting repeated reads at the transport boundary, the proxy stops duplicate payloads from consuming provider rate limits and read credits.

Introducing NodeCache: A Dedicated EVM RPC Caching Layer

NodeCache is an EVM RPC caching layer for read-only JSON-RPC calls (eth_call, eth_getBalance, eth_getCode, eth_getLogs, eth_blockNumber, eth_chainId), caching responses per method and per set of request parameters for a short, fixed time: eth_chainId for one hour (it never changes) and every other supported method, including eth_blockNumber, for a few seconds. The cache lifetimes are fixed by NodeCache and cannot be configured by the caller. It supports Ethereum mainnet only today. It does not proxy or cache state-changing methods (transactions): any method other than the six listed is rejected with an error.

By routing read traffic through NodeCache, applications direct repetitive polling and read traffic to cached records. Methods that query unchanged parameters receive the stored response during that active window, lowering the volume of outbound network requests sent to base providers.

Teams handling high read volumes can point their read-only mainnet endpoints to NodeCache to cache eth_call responses and related state checks.

Frequently asked questions

How does a caching layer distinguish between identical and different RPC calls?

A caching layer computes a key using both the JSON-RPC method name and its specific parameter payload. If any parameter value, contract address, block tag, or argument differs, the generated key differs, preventing cross-request collisions.

Why are read-only RPC calls cached rather than state-changing methods?

Read-only RPC methods query blockchain state without generating transactions or updating state on-chain, allowing identical calls to safely return identical data for the duration of the cache lifetime. State-changing methods submit transactions to the mempool and alter state, requiring direct network dispatch instead of caching.

When is an in-memory cache advantageous over querying a provider directly?

An intermediary cache serves value when multiple background jobs, application instances, or frontend users request identical blockchain state within a short interval. Serving unexpired responses from a cache intercepts redundant traffic before it reaches upstream provider rate limits.

Explore how NodeCache handles read-only Ethereum mainnet RPC calls with fixed-lifetime caching.

custom rpc cache vs managed service · rpc caching proxy · ethereum read rpc cache · cache eth_call · json rpc caching · evm read layer

Related Articles

All NodeCache EVM articles → · NodeCache EVM documentation →