NodeCache EVM
← Back to blog

Migrating dApp from Direct RPC to Cached Reads on Ethereum

Migrating dApp from Direct RPC to Cached Reads on Ethereum
Photo by lonely blue on Unsplash

November 3, 2026

Migrating dapp from direct rpc to cached infrastructure involves directing repetitive read-only queries away from your primary node provider into an intermediate proxy that stores identical calls. This architectural change intercepts repeated queries for identical parameters before they reach upstream node providers, limiting rate-limit throttling and redundant request fees.

Why direct RPC queries create cost and rate limit issues

Ethereum backends, indexing daemons, and client-facing interfaces frequently poll the network to keep their internal state synchronized with the blockchain. Standard application architectures route every data request directly to providers like Infura or Alchemy through JSON-RPC over HTTP or WebSockets. In a typical application, several decoupled components query the identical block number, account balances, and smart contract state variables concurrently.

Consider an application tracking decentralized finance positions. A background worker runs an evaluation loop every few seconds to inspect token reserves via eth_call, confirm user collateral balances via eth_getBalance, and poll for events using eth_getLogs. When user traffic increases, multiple application instances make these identical calls simultaneously. Because Ethereum mainnet produces blocks roughly once every twelve seconds, data returned by the node does not change between every microsecond query. However, the upstream provider processes each request individually, incrementing request counters and consuming rate-limit allocations for data that is identical to the previous response.

This is the kind of problem NodeCache is built to address.

Why read-heavy workloads fail to scale without a cache

The fundamental issue with direct RPC access is that infrastructure load scales with internal application activity rather than with state change frequency on the blockchain. When an indexer processes a stream of contract events, or when concurrent web visitors load the same dashboard, read volume grows linearly. Because standard EVM clients do not maintain a shared response layer across separate incoming requests, every process produces its own network round-trip.

Direct queries also subject infrastructure to rate-limit throttling. Providers enforce daily request quotas and per-second compute unit caps. When worker loops or bursty user traffic query identical eth_call contract states repeatedly, the application risks hitting these thresholds. The application then drops requests, throttles operations, or requires plan upgrades to accommodate volume that consists largely of duplicated lookups.

To decouple read volume from upstream node capacity, teams introduce intermediate caching. By intercepting read-only calls and returning stored payloads for identical parameters during a short validity window, the backend reduces upstream network round-trips without altering how application logic consumes blockchain data.

How NodeCache operates as an RPC caching layer

NodeCache functions as a dedicated caching layer for read-only EVM JSON-RPC calls on Ethereum mainnet. It sits between your application architecture and your upstream node provider, caching responses per method and per set of request parameters.

NodeCache supports six specific read-only methods:

Cache lifetimes are fixed directly by NodeCache. Calls to eth_chainId are cached for one hour, as chain identifiers remain constant. The remaining five supported methods—eth_blockNumber, eth_getBalance, eth_getCode, eth_call, and eth_getLogs—are cached for a few seconds. This window absorbs high-frequency polling and duplicate concurrent reads without requiring manual cache invalidation pipelines.

NodeCache operates strictly on read operations on Ethereum mainnet. It does not proxy or cache state-changing methods such as transactions; any JSON-RPC method outside the six supported read methods is rejected with an error. When migrating an application, developers point their read-only JSON-RPC transport client to the NodeCache endpoint URL while maintaining a direct connection to a standard provider for transaction submission.

Implementing NodeCache allows teams to isolate repetitive read patterns and avoid dispatching duplicate JSON-RPC payloads to upstream node infrastructure.

Frequently asked questions

Which JSON-RPC calls are candidates for read caching?

Read-only methods that query state by parameter—such as contract reads with eth_call, balance lookups with eth_getBalance, code queries with eth_getCode, and log filters with eth_getLogs—are candidates for response caching. Methods that send signed transactions or modify network state require direct routing to transaction-supporting nodes.

How does short-term caching handle state updates?

Short-term caching retains query responses for a small window of seconds rather than extended durations. Because new blocks on Ethereum mainnet arrive at regular intervals, keeping reads in memory for a few seconds absorbs bursts of identical queries while allowing the application to observe subsequent block state once the fixed duration passes.

How should an application route traffic when using an RPC cache?

Applications separate read-only requests from transaction requests by maintaining two client configurations. The read-only client points to the caching endpoint to handle inspection methods, while write operations such as transaction broadcasting route directly to a standard provider endpoint.

Point your Ethereum mainnet read traffic to NodeCache to cache read-only JSON-RPC calls.

migrating dapp from direct rpc to cached · reduce ethereum rpc costs · cache eth_call responses · ethereum rpc rate limit workaround · rpc caching layer for ethereum · lower infura alchemy rpc costs

Related Articles

All NodeCache EVM articles → · NodeCache EVM documentation →