Skip to content

@loontail/minecraft-kit / createMemoryCache

Function: createMemoryCache()

ts
function createMemoryCache(options?): MetadataCache;

Defined in: src/http/cache.ts:34

In-memory metadata cache backed by lru-cache. Suitable for short-lived processes; pass a custom MetadataCache to share entries across runs (Redis, disk, etc.).

Parameters

ParameterType
optionsMemoryCacheOptions

Returns

MetadataCache

Example

ts
import { createMemoryCache, MinecraftKit } from "@loontail/minecraft-kit";

const cache = createMemoryCache({ maxEntries: 128 });
const kit = new MinecraftKit({ cache });
// Version manifests and asset indexes are cached across kit operations.

MIT License