RedisStore
Redis-based cache store implementation. Provides a high-performance caching solution recommended for production environments.
Example
import { RedisStore } from "@baeta/extension-cache-redis";
import Redis from "ioredis";
const redis = new Redis("redis://localhost:6379");
const store = new RedisStore(redis);
// Use with cache extension
const cacheExt = cacheExtension(store, {
ttl: 3600,
});
Extends
Constructors
Constructor
new RedisStore(
client):RedisStore
Parameters
| Parameter | Type |
|---|---|
|
|
|
Returns
RedisStore
Overrides
Properties
| Property | Modifier | Type |
|---|---|---|
|
|
|
Methods
createStoreAdapter()
createStoreAdapter<
T>(serialzier,options,type,hash):StoreAdapter<T>
Creates a new store adapter for a specific type
Type Parameters
| Type Parameter |
|---|
|
|
Parameters
| Parameter | Type | Description |
|---|---|---|
|
|
Serializer instance | |
|
|
|
Store configuration options |
|
|
|
Type name for the cached items |
|
|
|
Unique hash for the type |
Returns
StoreAdapter<T>