Skip to main content

cache

@rotorsoft/act-root


@rotorsoft/act-root / act/src / cache

Variable: cache

const cache: (adapter?) => Cache

Defined in: libs/act/src/ports.ts:285

Gets or injects the singleton cache.

By default, Act uses an in-memory LRU cache. For distributed deployments, inject a Redis-backed cache before building your application.

Cache unifies snapshotting — snap() writes to cache instead of the event store, and load() checks cache before querying the store for tail events.

Parameters

adapter?

Cache

Optional cache implementation to inject

Returns

Cache

The singleton cache instance