lru
lru copied to clipboard
A simple LRU cache
Query the key and value pair of the least recently used without marking the key as most recently used.
this remove the dependency of inherits
Make sure the type of `key` is string
remove hasOwnProp and using `Object.create(null)` should boost the perf a bit.
so, why not? I use [bench-lru](https://github.com/dominictarr/bench-lru) for benchmarking. before: ``` name, set, get1, update, get2, evict lru-cache, 350, 1449, 546, 2083, 383 hashlru, 6667, 12500, 12500, 12500, 5000 lru, 1852,...
Hello, I have a use case where I'm querying an API that tells browsers not to cache its responses. As a user bounces around from page to page in my...
This closes #32. Adds the `.vacate()` method, which evicts all entries. This is different from `.clear()`, as `.vacate()` fires the `evict` event for all entries upon their removal.
It'd be quite nice to be able to call the `evict` event on all entries upon clearing the cache. This would have the benefit of being able to do something...
Just a though about keys property, don't you think it should evict old elements and return only valid keys regarding maxAge? This will clean the cache more aggressively but getting...
Added missing dep https://github.com/chriso/lru/blob/ee57d6036575a1611a1d31f75d3dc94f313d5e87/index.js#L1