Add options.ttl, which will make the cache throw out items that are older than the specified TTL in ms.
Use performance.now() if available, fall back to Date.now().
Expired items are not preemptively removed, and they still contribute to the LRU count until removed. They're just deleted on get() if they're expired, and not returned unless allowStale: true is set on the cache.
Date updated on get if updateAgeOnGet:true in cache options.
Add
options.ttl
, which will make the cache throw out items that are older than the specified TTL in ms.Use performance.now() if available, fall back to Date.now().
Expired items are not preemptively removed, and they still contribute to the LRU count until removed. They're just deleted on get() if they're expired, and not returned unless
allowStale: true
is set on the cache.Date updated on get if
updateAgeOnGet:true
in cache options.