Class InMemoryCache

In-memory cache strategy

Hierarchy

  • InMemoryCache

Implements

  • CacheStrategy

Constructors

Methods

Constructors

Methods

  • Clear the entire cache

    Returns Promise<void>

  • Get a value from the cache

    Type Parameters

    • T

    Parameters

    • key: string

      Cache key

    Returns Promise<null | T>

    Cached value or null if not found or expired

  • Invalidate a cache entry

    Parameters

    • key: string

      Cache key

    Returns Promise<void>

  • Set a value in the cache

    Type Parameters

    • T

    Parameters

    • key: string

      Cache key

    • value: T

      Value to cache

    • Optional ttl: number

      Time to live in milliseconds (optional)

    Returns Promise<void>

Generated using TypeDoc