SetCacheProps
Properties for the setCache method.
interface SetCacheProps<TData> {
data: () => Promise<TData>;
key: string;
tags?: (data: TData) => string[];
timeToLive?: number;
}Properties
| Name | Required | Type | Description |
|---|---|---|---|
data | Required | () => Promise<TData> | Callback returning the data to be stored in Redis. |
key | Required | string | The key under which the data will be stored in Redis. |
tags | Optional | (data: TData) => string[] | Callback returning the invalidation tags to be associated with the record's key in Redis. |
timeToLive | Optional | number | The time in seconds after which the record will be deleted. Overrides the defaultTimeToLive option from the SDK module config. |