@baeta/extension-cache-upstash
Classes
UpstashStore
Upstash Redis-based cache store implementation. Provides a serverless-optimized caching solution ideal for edge and serverless environments.
Remarks
This implementation uses Upstash Redis and is designed for serverless architectures.
Example
import { UpstashStore } from "@baeta/extension-cache-upstash";
import { Redis } from "@upstash/redis";
const redis = new Redis({
url: "UPSTASH_REDIS_URL",
token: "UPSTASH_REDIS_TOKEN",
});
const store = new UpstashStore(redis);
// Use with cache extension
const cacheExt = cacheExtension(store, {
ttl: 3600,
});
Extends
Store
Constructors
new UpstashStore()
new UpstashStore(
client
):UpstashStore
Parameters
Parameter | Type |
---|---|
|
|
Returns
Overrides
Store.constructor
Properties
Property | Modifier | Type |
---|---|---|
|
|
|
Methods
createStoreAdapter()
createStoreAdapter<
T
>(options
,type
,hash
):StoreAdapter
<T
>
Creates a new store adapter for a specific type
Type Parameters
Type Parameter |
---|
|
Parameters
Parameter | Type | Description |
---|---|---|
|
|
Store configuration options |
|
|
Type name for the cached items |
|
|
Unique hash for the type |
Returns
StoreAdapter
<T
>
Overrides
Store.createStoreAdapter