prorm API Reference
    Preparing search index...

    Class AbstractCacheManagerAbstract

    Abstract cache manager with L1/L2 support

    Hierarchy (View Summary)

    Implements

    Index
    options: Required<CacheManagerConfig>
    stats: CacheStats = ...
    • Build a full cache key with prefix

      Parameters

      • key: string

      Returns string

    • Get a value from cache

      Parameters

      • key: string

        Cache key

      Returns Promise<string | null>

      Cached value or null if not found

    • Set a value in cache

      Parameters

      • key: string

        Cache key

      • value: string

        Value to cache

      • Optionalttl: number

        Time to live in seconds (optional)

      Returns Promise<boolean>

      True if successful

    • Delete a key from cache

      Parameters

      • key: string

        Cache key

      Returns Promise<boolean>

      True if key was deleted

    • Check if a key exists in cache

      Parameters

      • key: string

        Cache key

      Returns Promise<boolean>

      True if key exists

    • Invalidate all keys matching a pattern

      Parameters

      • pattern: string

        Key pattern (supports glob patterns like user:*)

      Returns Promise<number>

      Number of keys invalidated

    • Get multiple keys at once

      Parameters

      • keys: string[]

        Array of cache keys

      Returns Promise<(string | null)[]>

      Array of values (null for missing keys)

    • Set multiple keys at once

      Parameters

      • entries: { key: string; value: string; ttl?: number }[]

        Array of {key, value, ttl?} objects

      Returns Promise<boolean>

      True if successful