Function withCachePrefix

  • Creates a plugin that prefixes all keys passed to a cache adapter.

    Every method that accepts a cache key will have the given prefix prepended before the call is forwarded to the underlying adapter. This is useful for namespacing cache entries when multiple independent consumers share the same cache backend.

    Parameters

    • prefix: string

      The string to prepend to every cache key.

    Returns PluginFn<ICacheAdapter>

    A middleware plugin that wraps an ICacheAdapter.

    IMPORT_PATH: "@daiso-tech/core/cache/plugins"