Redis-backed cache store implementation.
Values are JSON-serialized before storage so that arbitrary types can be
cached. The prefix is applied at construction time and used exclusively
by clear() to scope the SCAN+DEL to this instance's keys.
RedisStore(prefix: string,options?: { url?: string | undefined; client?: IRedisClient | undefined; })
Key prefix for scoping clear() to this instance's keys.
An empty prefix would scan * in clear() — acceptable only for single-
tenant Redis deployments.
options: { url?: string | undefined; client?: IRedisClient | undefined; }
Redis connection and client options
clear(): Promise<void>
Remove all entries scoped to this backend's prefix.
The prefix is provided at construction time (not per-call), so each backend can scope the clear appropriately:
- Redis:
SCAN MATCH ${prefix}*+ batch DEL - Memory: empty the internal map (each plugin instance owns its own map, so it naturally holds only this prefix's keys)
connect(): Promise<void>
Establish the backend connection (if applicable).
delete(key: string): Promise<boolean>
Delete a value. The key is already-prefixed by CacheService.
disconnect(): Promise<void>
Gracefully disconnect.
get<T>(key: string): Promise<T | null>
Read a value. The key is already-prefixed by CacheService.
has(key: string): Promise<boolean>
Check existence. The key is already-prefixed by CacheService.
isHealthy(): Promise<boolean>
Probes Redis with a typed ping() (M90b). false after disconnect —
a store with no client cannot answer — and otherwise true only when
the server answers, a rejection being unreachability.
The plugin caches and bounds this probe; this method is the raw per-call question.
isReady(): boolean
Reports whether the backend is ready for operations.
set<T>(key: string,value: T,ttlSeconds?: number): Promise<void>
Write a value. The key is already-prefixed by CacheService.