Optionaloptions: { clock?: ClockFn; maxSize?: number }
Configuration
Optionalclock?: ClockFnMonotonic clock function (default bound performance.now)
OptionalmaxSize?: numberMaximum entry count (default 1000)
Remove all entries scoped to this backend's prefix.
The prefix is provided at construction time (not per-call), so each backend can scope the clear appropriately:
SCAN MATCH ${prefix}* + batch DELEstablish the backend connection (if applicable).
Delete a value. The key is already-prefixed by CacheService.
Already-prefixed cache key
true if removed
Gracefully disconnect.
Read a value. The key is already-prefixed by CacheService.
Expected value type
Already-prefixed cache key
The deserialized value, or null when absent/expired
Check existence. The key is already-prefixed by CacheService.
Already-prefixed cache key
true if present and unexpired
Reports whether the backend is ready for operations.
Write a value. The key is already-prefixed by CacheService.
Value type
Already-prefixed cache key
Value to store
OptionalttlSeconds: number
Optional TTL in seconds
In-memory cache implementation with LRU eviction and lazy TTL expiry.
On
getof a live entry, the entry is deleted and re-inserted (moves to MRU position). Onset, if the map exceedsmaxSize, the oldest entry (first Map key) is evicted. Expired entries are lazily deleted on read (get/has).The constructor accepts a
prefixfor interface parity with other backends, but MemoryStore intentionally does not use it: each plugin instance owns its own Map, so emptying it inclear()naturally scopes to this instance.Since
0.1.0