Interface: CacheOptions
Options for an AppKit-independent memory-first cache.
Extends
Section titled “Extends”Pick<CacheableOptions,"cacheId"|"maxTtl"|"namespace"|"stats"|"tags"|"ttl">
Extended by
Section titled “Extended by”Properties
Section titled “Properties”cacheId?
Section titled “cacheId?”
optionalcacheId?:string
The cacheId for the cacheable instance. This is primarily used for the wrap function to not have conflicts. If it is not set then it will be a random string that is generated
Inherited from
Section titled “Inherited from”Pick.cacheId
levels?
Section titled “levels?”
readonlyoptionallevels?: readonlyCacheLevel[]
Additional ordered persistence levels. No levels creates a memory-only cache.
maxEntries?
Section titled “maxEntries?”
readonlyoptionalmaxEntries?:number
Maximum entries retained in the memory primary. Defaults to 1,000.
maxTtl?
Section titled “maxTtl?”
optionalmaxTtl?:string|number
The maximum time-to-live for the cacheable instance. When set, any TTL that exceeds this value
is capped to maxTtl. Entries with no TTL will also be capped to maxTtl.
Can be a number in milliseconds or a human-readable format such as 1s, 1m, 1h, 1d.
Default is undefined (no maximum).
Inherited from
Section titled “Inherited from”Pick.maxTtl
namespace?
Section titled “namespace?”
optionalnamespace?:string| (() =>string)
The namespace for the cacheable instance. It can be a string or a function that returns a string.
Inherited from
Section titled “Inherited from”Pick.namespace
stats?
Section titled “stats?”
optionalstats?:boolean
Whether to enable statistics for the cacheable instance
Inherited from
Section titled “Inherited from”Pick.stats
optionaltags?:boolean
Enables the tag service so tag-based invalidation can be used and freshness checks run on
every get / getMany. Tags must be explicitly enabled — while disabled, all tag
operations are no-ops and values set with tags are stored without tag tracking. Enable
this on every instance that shares the store (writers and readers) so invalidations are
honored consistently across distributed instances. Default is false.
Inherited from
Section titled “Inherited from”Pick.tags
optionalttl?:string|number
The time-to-live for the cacheable instance and will be used as the default value.
can be a number in milliseconds or a human-readable format such as 1s for 1 second or 1h for 1 hour
or undefined if there is no time-to-live.
Inherited from
Section titled “Inherited from”Pick.ttl
useClone?
Section titled “useClone?”
readonlyoptionaluseClone?:boolean
Whether memory reads clone values. Defaults to true.
writeDelayMs?
Section titled “writeDelayMs?”
readonlyoptionalwriteDelayMs?:number
Delay used to coalesce persistence mutations. Defaults to 25 milliseconds.