Skip to main content

CacheClient

Handles data caching for faster access. Extends @perseid/core HttpClient class.


cachePath

Cache file path.

protected cachePath: string;

delete

Deletes cached data stored at key.

public delete(key: string): Promise<void>;

Parameters

  • settings: Cache client settings. constructor(settings: CacheClientSettings);
  • key: Key containing cached data.

Usage

TODO

get

Fetches cached data stored at key.

public get(key: string): Promise<string | null>;

Parameters

  • key: Key containing cached data.
  • key: Key containing cached data.

Returns

Cached data if it exists, null otherwise.

Usage

TODO

set

Stores data in cache, at key.

public set(key: string, data: unknown, duration: number): Promise<void>;

Parameters

  • key: Key containing cached data.
  • key: Key to store data at.
  • data: Data to store in cache.
  • duration: Duration, in seconds, for which to keep data in cache.

Usage

TODO