[]previous and next page

createKeyValueCacheStore

A CacheStore over a Redis-like client.

A CacheStore over a Redis-like client. Each entry is one JSON string with a millisecond expiry at the end of its stale window; each tag is a set of keys. The adapter never reads the client's internals, so any client with the KeyValueClient methods works.

Import#

ts
import { createKeyValueCacheStore } from "@shadow-js/dusk/server";

Signature#

ts
function createKeyValueCacheStore(
  client: KeyValueClient,
  options: KeyValueCacheStoreOptions = {},
): CacheStore

Parameters#

Name Description
client The key-value client.
options Prefix and clock.

Returns#

A store.

Examples#

ts
const store = createKeyValueCacheStore(redisClient, { prefix: "app:isr:" });