isaacs / node-lru-cache

A fast cache that automatically deletes the least recently used items
http://isaacs.github.io/node-lru-cache/
ISC License
5.38k stars 353 forks source link

v7: size calculations #187

Closed isaacs closed 2 years ago

isaacs commented 2 years ago

Track size on the LRUEntry object.

Track currentSize and oldSize values, update as entries are moved around.

Drop when currentSize is >= max.