CacheKit Docs

High-performance cache policies and supporting data structures.

View the Project on GitHub OxidizeLabs/cachekit

Aging / Decayed LFU (Design Patterns)

LFU without aging tends to accumulate “historical winners” that stop being relevant.

Below are common, implementable aging strategies.

1) Periodic Global Decay (Halving)

Every T seconds (or every N accesses), apply:

Tradeoffs:

Amortization approaches:

2) Epoch-Based Lazy Decay

Store per-entry:

On access:

Tradeoffs:

3) Windowed LFU (Count-Min Sketch + Window)

For very large keyspaces (web caches), maintain approximate counts over a window:

Tradeoffs:

References