Stone.js API
    Preparing search index...

    Multi-store cache registry.

    Application code resolves a store by name (cacheManager.store('redis')) and talks to it through the agnostic CacheStore contract, so the concrete backend is a registration detail. A memory store is registered by default. The manager also exposes a process-wide default instance so the method decorators (@Cacheable, @CacheEvict, @CachePut) can reach it without wiring.

    Index
    • Parameters

      • defaultStore: string = 'memory'

        The name of the default store.

      Returns CacheManager

    • Whether a store (instance or factory) is registered under the name.

      Parameters

      • name: string

        The store name.

      Returns boolean

      True if registered.

    • Register a ready-made store instance.

      Parameters

      • name: string

        The store name.

      • store: CacheStore

        The store instance.

      Returns this

      This manager for chaining.

    • Register a lazy factory for a store (built on first access).

      Parameters

      Returns this

      This manager for chaining.

    • Set the default store name.

      Parameters

      • name: string

        The store name.

      Returns this

      This manager for chaining.

    • Resolve a store by name (defaults to the default store).

      Parameters

      • Optionalname: string

        The store name.

      Returns CacheStore

      The resolved CacheStore.

      When no store/factory is registered under the name.

    • Create a CacheManager.

      Parameters

      • defaultStore: string = 'memory'

        The name of the default store.

      Returns CacheManager

      A new CacheManager.

    • The process-wide default manager, if the cache module has been booted.

      Returns CacheManager

      The manager, or undefined.

    • Register (or replace) the process-wide default manager used by the method decorators.

      Parameters

      • Optionalmanager: CacheManager

        The manager instance (or undefined to clear).

      Returns void