#lifetime #least #cache #entries #recently

yanked tlru

Time-aware Least Recently Used cache implementation

0.1.1 Jan 11, 2021
0.1.0 Jan 10, 2021

MIT license

857 lines

TLRU - Time aware Least Recently Used cache

This crate provides two caches:

  • FixedCapacity which is a TLRU cache, with fixed capacity and lifetime
  • FlexibleCapacity which is a cache where entries are evicted after a certain time.

WARNING - Here be dragons

  • Highly experimental, use at your own risk.
  • API subject to change.


TLRU implements a Time-aware Least Recently Used cache.

TLRU is a cache algorithm that, if full, evicts the entry that was accessed least recently. In TLRU, cache entries have a finite lifetime, meaning even if the cache is not full, entries can get evicted. In this implementation, accessing a cache entry does not modify its lifetime.

No runtime deps