class RedisCacheAdapter
implements CacheAdapter

Redis-backed cache adapter using GET/SET/DEL with optional TTL via PX.

Constructors

new
RedisCacheAdapter(
redis: RedisClient,
prefix: string,
)

Methods

close(): Promise<void>
delete(key: string): Promise<void>
get(key: string): Promise<unknown | null>
has(key: string): Promise<boolean>
private
key(key: string): string
set(
key: string,
value: unknown,
options?: SetOptions,
): Promise<void>

Usage

import { RedisCacheAdapter } from ".";