Optional
noSet to true to suppress calling the OptionsBase.dispose function if the entry key is still accessible within the cache. This may be overridden by passing an options object to LRUCache#set.
Optional
noBoolean flag to tell the cache to not update the TTL when setting a new value for an existing key (ie, when updating a value rather than inserting a new value). Note that the TTL value is always set (if provided) when adding a new entry into the cache.
Has no effect if a OptionsBase.ttl is not set.
Optional
sizeIf size tracking is enabled, then setting an explicit size in the LRUCache#set call will prevent calling the OptionsBase.sizeCalculation function.
Optional
sizeA function that returns a number indicating the item's size.
If not provided, and OptionsBase.maxSize or OptionsBase.maxEntrySize are set, then all LRUCache#set calls must provide an explicit SetOptions.size or sizeCalculation param.
Optional
startIf TTL tracking is enabled, then setting an explicit start
time in the LRUCache#set call will override the
default time from performance.now()
or Date.now()
.
Note that it must be a valid value for whichever time-tracking method is in use.
Optional
statusOptional
ttlMax time in milliseconds for items to live in cache before they are considered stale. Note that stale items are NOT preemptively removed by default, and MAY live in the cache long after they have expired.
Also, as this cache is optimized for LRU/MRU operations, some of the staleness/TTL checks will reduce performance, as they will incur overhead by deleting items.
Must be an integer number of ms. If set to 0, this indicates "no TTL"
0
Generated using TypeDoc
Options that may be passed to the LRUCache#set method.