contain-rs / lru-cache

A cache that holds a limited number of key-value pairs

Home Page:https://contain-rs.github.io/lru-cache/lru_cache/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for random-lru eviction policy

yacoder opened this issue · comments

Tag each entry with "last-used-at" timestamp, and at eviction time pick the LRU among N randomly selected entries.

This is one of the eviction policies supported by Redis: http://redis.io/topics/lru-cache

Maybe it should be a separate container though, because it won't need the linked hash map.