The cache allows storing and retrieving JSON-serializable values that persist
across handler invocations. Useful for caching computed results, tracking
cumulative state, or storing intermediate processing data.
Returns MemoryCache
The MemoryCache instance, or undefined if cache is not available
Example
// Store and retrieve values awaitctx.cache.set('totalVolume', volume) constcached = awaitctx.cache.get<number>('totalVolume')
// Block-scoped values (isolated per block) awaitctx.cache.setInBlock('blockCount', count)
Access the in-memory key-value cache.
The cache allows storing and retrieving JSON-serializable values that persist across handler invocations. Useful for caching computed results, tracking cumulative state, or storing intermediate processing data.