Originally published on tamiz.pro .
Next.js 15's App Router ships with four distinct caching layers, and confusing them is the single most common source of stale data, memory leaks, and mysterious 404s in production. This deep dive maps every layer — Request Memoization, the Data Cache, the Full Route Cache, and the Router Cache — then walks through the advanced patterns that actually work in production: tag-based invalidation, unstable_cache with custom keys, time-based revalidation (ISR), and cache-aware streaming. By the end, you'll know exactly which cache is serving a request, why it's serving it, and how to invalidate it deterministically.
1. The Four Caching Layers: A Mental Model
2. Layer 1 — Request Memoization
3. Layer 2 — The Data Cache
4. Layer 3 — The Full Route Cache
5. Layer 4 — The Router Cache
6. Advanced Pattern: Tag-Based Revalidation with revalidateTag
7. Advanced Pattern: unstable_cache with Custom Keys
8. Advanced Pattern: Time-Based Revalidation (ISR) Done Right
9.…