Releases: aleclarson/quick-lru
Releases · aleclarson/quick-lru
Release list
5.3.0
This release backports selected fixes and improvements from the upstream quick-lru package while retaining CommonJS support.
Backported features
- Add global cache expiration with the
maxAgeconstructor option. - Add per-entry expiration with
set(key, value, {maxAge}). - Add
expiresIn(key)for inspecting an entry’s remaining TTL. - Add
entriesAscending()andentriesDescending()for explicit recency-order iteration.
Backported improvements
- Refresh an entry’s expiration when it is updated.
- Remove expired entries lazily during cache operations.
- Call
onEvictionfor capacity and TTL evictions, but not fordelete()orclear(). - Add regression coverage for function values and non-primitive keys.
- Expand documentation for expiration behavior and the dual-cache memory tradeoff.
Cache sizing
As in upstream quick-lru, the dual-cache algorithm may physically retain up to twice the configured maxSize between rotations. The reported .size does not exceed maxSize.