← 🌐 Computer Networks

📦 Cache Lab

Eviction policy
Live stats
Policy: LRU
Requests: 0
Hits: 0
Misses: 0
Hit rate: 0%
FPS:
Drag — rotate · Scroll — zoom

📦 CDN Caching: LRU vs LFU Under Real Zipf Traffic

A ring of cache slots sits at the edge of a simulated CDN node. A Zipf-distributed stream of content requests flies in as colored orbs, and you can switch the eviction policy live to compare how LRU and LFU cope with the same skewed traffic.

🔬 What It Demonstrates

Real content demand is heavily skewed — a small share of items get most requests. LRU evicts the slot untouched the longest; LFU evicts the slot with the fewest total hits. Under high skew, LFU tends to hold onto "hot" items more reliably.

🎮 How to Use

Toggle LRU/LFU, then adjust cache size, Zipf skew (α), catalog size and request speed. Watch cube colors, hit/miss flashes and the outer popularity histogram respond, and track the live hit-rate bar.

💡 Did You Know?

Production CDNs rarely use pure LRU or LFU — hybrids like W-TinyLFU and ARC blend recency and frequency signals specifically to resist cache pollution from one-off crawler traffic.