Skip to content

@loontail/minecraft-kit v0.8.14 / createMemoryCache

Function: createMemoryCache()

ts
function createMemoryCache(options): MetadataCache

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.

Source

src/http/cache.ts:34

MIT License