Interface Cache

Hierarchy

  • Cache

Methods

Methods

  • Returns the cached/saved value for the specified cache key. If there was never a set for the same cache key, undefined is returned.

    If the value saved for the cache key is already expired, it is assumed to be not present, and undefined is returned.

    Type Parameters

    Type Parameters

    • T

    Parameters

    • cacheKey: string

    Returns undefined | T

  • Saves the value to the specified cache key. Optionally, an expiry in seconds can be specified. If the value is omitted, an implementation-details dependant default expiration is assumed.

    When implementing this interface, document what the default value for the expiry is.

    Type Parameters

    Type Parameters

    • T

    Parameters

    • cacheKey: string
    • value: T
    • Optional expiry: number

    Returns void

Generated using TypeDoc