The CacheStore backend implementation
Key prefix prepended to all keyed operations. Also passed
to the backend constructor for clear() scoping.
OptionaldefaultTtl: number
Default TTL in seconds applied when set() omits ttlSeconds
Delegates to the backend's clear(), which uses the construction-time
prefix to scope the deletion. CacheService does not prepend a key here
since clear() takes no key argument.
Removes a cached value.
Cache key
true if an entry was removed
Reads a cached value.
The expected value type
Cache key
The value, or null when absent or expired
Reads a cached value or produces and stores it once for all concurrent callers of this service and key.
The in-flight registry is cleared after either success or failure. A
rejected factory therefore leaves no poisoned entry and the next caller
gets a fresh attempt. The factory result is written with the same explicit
or default TTL resolution as set.
Value type associated with key
Cache key without the service prefix
Work that produces a value when the key is absent
OptionalttlSeconds: number
Optional TTL override for the produced value
The cached or newly-produced value
Reports whether a live entry exists.
Cache key
true if present and unexpired
Stores a value.
The value type
Cache key
Value to store
OptionalttlSeconds: number
Time-to-live in seconds; omit for the store default
Service layer that delegates to a backend
CacheStorewhile applying:get/set/delete/has). The prefix is also passed to the backend at construction so thatclear()can scope to it.set()is called withoutttlSeconds.When its CachePlugin was opted into diagnostics (M98i), each backend call is additionally counted —
getOrSet's internalgetandsetincluded. A service constructed directly carries no collector and runs unobserved.Since
0.1.0