createKvCacheStore
The ISR page cache over a KV store.
The ISR page cache over a KV store. The entry is stored under <prefix>entry:<key> with a TTL that ends
at its stale window; each tag is a list of keys under <prefix>tag:<tag>.
Import#
ts
import { createKvCacheStore } from "@shadow-js/dusk/server";
Signature#
ts
function createKvCacheStore(kv: KVStore, options: KvCacheStoreOptions = {}): CacheStore
Parameters#
| Name | Description |
|---|---|
kv |
The store. |
options |
Prefix, the bound of a tag, and the clock. |
Returns#
A CacheStore.
Examples#
ts
const cache = createKvCacheStore(createMemoryKVStore(), { prefix: "app:isr:" });