CacheKey

tagtree · /core·interface

Structured cache-key object produced by a KeyFactory; carries a primary tag for logging, the full invalidation fanout, and a qualifier-suffixed read tag for adapter lookups.

Properties

primary
string
The leaf tag without qualifier suffix, used in log messages to identify the cache entry.
readTag
string
Lookup key for the adapter's ``read``/``write`` calls; equals ``primary`` when no qualifier is set, or ``primary + "::" + qualifierKey`` when a qualifier is present.
tags
string[]
Full fanout from deepest (most specific) to shallowest (namespace root), used to populate the tag index on write.

Example

const key = cache.keys.product({ tenant: shop, id: '123' });
const data = await cache.wrap(key, () => fetchProduct('123'));

ContractTestOptions runAdapterContract AdapterCtx CacheAdapter CacheInstance CacheSchema CacheSchemaShape EntityDecl

Sourcekeys.ts:15Edit the JSDoc directly

On this page