CacheInstance
●tagtree · /core·interface
Fully-typed runtime handle returned by createCacheInstance; binds a cache schema, a storage
adapter, and derived key/invalidation helpers into a single callable surface.
Properties
PROPTYPEDESCRIPTION
invalidate
keys
schema
invalidateRaw
unknown
read
unknown
Example
const cache = createCacheInstance(productSchema, memoryAdapter());
const key = cache.keys.product({ tenant: shop, id: '123' });
const data = await cache.wrap(key, () => fetchProduct('123'), { ttl: 300 });
await cache.invalidate.product({ tenant: shop, id: '123' });Related
ContractTestOptions runAdapterContract AdapterCtx CacheAdapter CacheKey CacheSchema CacheSchemaShape EntityDecl
MetadataOpen in GitHub ↗
CacheAdapter
Contract that every cache backend must implement to integrate with tagtree's tagaware invalidation model. Adapters are responsible for storage, tagindex mainten
CacheKey
Structured cachekey object produced by a KeyFactory; carries a primary tag for logging, the full invalidation fanout, and a qualifiersuffixed read tag for adapt