HomeAlgorithms & AIMobile Cache Waterfall: TTL & Stale-While-Revalidate

Mobile Cache Waterfall: TTL & Stale-While-Revalidate

Interactive 3D simulation of a mobile app's multi-tier cache: memory (L1), disk (L2), and network, with per-tier TTL expiry and a stale-while-revalidate toggle. Watch requests fall through the tiers and read live hit-rate, latency, and network-byte stats.

Algorithms & AI3DModerate60 FPS📱 Mobile-adapted
mobile-caching-strategies ↗ Open standalone

A mobile app's cache is rarely one thing — it is a small fast memory tier backed by a larger slower disk tier backed by the network, each with its own time-to-live. This simulator issues a live stream of requests against a Zipf-weighted set of items and lets each one fall through memory, then disk, then network exactly as a real client cache would, timing every hop. A stale-while-revalidate toggle shows the difference between silently refreshing an expired entry in the background versus forcing the user to wait on a synchronous network round-trip, while live readouts track hit rate, average latency, network bytes transferred, and how full each tier is.

⚙ Under the hood

Watch requests fall through a mobile app's memory, disk and network cache tiers in real time, with per-tier TTL expiry and a stale-while-revalidate toggle that trades freshness for hidden latency.

cachingmobilettlstale-while-revalidatelrusystem-design

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)