Open yacoder opened 8 years ago
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.
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.