Original zarr.Array to wrap
L0 decompressed chunk cache instance
Full path to the array (used for cache key generation)
OptionalgetProbe: () => ResidencyProbe | null
Optional accessor for the currently-active residency
probe. Called on every getChunk to report hit/miss. Returning null
(the default / when no load is in flight) disables reporting — this is
how prefetch traffic is kept from contaminating a demand load's signal.
OptionalgetSignal: () => AbortSignal | null
Optional accessor for the currently-active per-update
AbortSignal. Called on every getChunk; if it returns an aborted
signal the call throws (AbortError) BEFORE any L0 lookup, cache fetch,
or Blosc decode — so a superseded updateView bails on the warm-cache
hit path too (zarrita's own throwIfAborted only fires between chunks
of a multi-chunk selection). Mirrors the getProbe thunk lifetime: it
reads the owning loader's transient per-update field, so it is naturally
per-caller and never aborts a coalesced chunk another live caller awaits.
Proxied zarr.Array with L0 caching enabled
const cache = new DecompressedChunkCache({ maxSize: 200 * 1024 * 1024 });
// Wrap array after opening
const rawArray = await zarr.open(location.resolve('positions'), { kind: 'array' });
const cachedArray = wrapWithCache(rawArray, cache, '/scene/points/positions');
// Use normally - getChunk() now checks L0 cache
const chunk = await cachedArray.getChunk([0, 1, 2]);
// First call: decompresses and caches
// Subsequent calls: returns from L0 cache instantly
Wrap a zarr.Array with L0 decompressed chunk caching.
The returned proxy intercepts
getChunk()calls:getChunk(), caches result, returns dataAll other zarr.Array properties and methods pass through unchanged.