WriteOpts
●tagtree · /core·interface
Options that govern how a cache entry is stored; controls TTL expiry, stale-while-revalidate behavior, and a staleness-guard timestamp that prevents a racing webhook from being overwritten by a fetch that started before the invalidation arrived.
Properties
PROPTYPEDESCRIPTION
swr?
boolean
When ``true``, the adapter may return a stale entry and revalidate in the background.
ttl?
number
Entry lifetime in seconds; omit for indefinite storage.
writeIfNewerThan?
number
Reject the write if any of the entry's tags were invalidated after this epoch timestamp.
Example
await instance.write(key, data, { ttl: 300, swr: true });Related
ContractTestOptions runAdapterContract AdapterCtx CacheAdapter CacheInstance CacheKey CacheSchema CacheSchemaShape
MetadataOpen in GitHub ↗