[]previous and next page

createMemoryCacheStore

An in-process cache store: a Map kept in least-recently-used order, bounded by maxEntries.

An in-process cache store: a Map kept in least-recently-used order, bounded by maxEntries. Entries are kept as objects, so it is only as shared as the process; use a shared store behind several instances.

Import#

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

Signature#

ts
function createMemoryCacheStore(options: MemoryCacheStoreOptions = {}): CacheStore

Parameters#

Name Description
options The bound.

Returns#

A store.

Throws#

  • RangeError when maxEntries is not a positive integer.

Examples#

ts
const store = createMemoryCacheStore({ maxEntries: 1000 });