method Cache.prototype.set
Cache.prototype.set(
key: string,
value: unknown,
options?: SetOptions,
): Task<void, CacheSetFailed>

Store a value with an optional TTL.

Examples

Example 1

await cache.set("session:abc", sessionData, { ttl: 3600_000 }).run();

Parameters

key: string
value: unknown
optional
options: SetOptions

Return Type

Task<void, CacheSetFailed>

Usage

import { Cache } from ".";