@freedomofpress/webcat
    Preparing search index...

    Class PersistentLRUCache<K, V>

    A persistent LRUCache. Supported value types are limited by the storage API. In addition to JSON-ifiable values, i.e. Plain Old JavaScript Objects (POJOs), accepted by the storage API, arbitrary objects that implement the Pojoifiable interface can be cached. The conversion from Pojoifiable (and back via the Depojoifier interface) is handled automatically.

    Type Parameters

    • K extends string

      The type of cache keys.

    • V extends Pojoifiable | unknown

      The type of values store in this cache.

    Hierarchy (View Summary)

    Index
    • Clears a single value from the cache.

      Parameters

      • key: K

        The key to clear.

      Returns Promise<void>

    • Reads a cached value.

      Parameters

      • key: K

        The key to read.

      Returns Promise<V | undefined>

      A Promise that resolves with the value read.

    • Parameters

      • key: K

      Returns Promise<boolean>

      A Promise that resolves to true if the given key exists in the cache.

    • Caches a value.

      Parameters

      • key: K

        The key to use.

      • value: V

        The value to cache.

      Returns Promise<void>