Skip to content

Releases: aleclarson/quick-lru

Release list

5.3.0

Choose a tag to compare

@aleclarson aleclarson released this 31 Aug 17:25

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 maxAge constructor option.
  • Add per-entry expiration with set(key, value, {maxAge}).
  • Add expiresIn(key) for inspecting an entry’s remaining TTL.
  • Add entriesAscending() and entriesDescending() for explicit recency-order iteration.

Backported improvements

  • Refresh an entry’s expiration when it is updated.
  • Remove expired entries lazily during cache operations.
  • Call onEviction for capacity and TTL evictions, but not for delete() or clear().
  • 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.