OrderNot attempted
The cache layers
Order the cache layers a request passes through, from closest to the user to the source of truth.
Drag the rows, or use the arrows, to put them in order from first to last.
- Database / upstream API
- Next.js Data Cache (opt-in since Next 15:
force-cache,next.revalidate, tags) - Next.js Full Route Cache (prerendered HTML + RSC payload,
revalidate) - CDN / Edge cache (s-maxage)
- Browser cache (Cache-Control max-age)
Show answer & explanation
Correct order:
- Browser cache (Cache-Control max-age)
- CDN / Edge cache (s-maxage)
- Next.js Full Route Cache (prerendered HTML + RSC payload,
revalidate) - Next.js Data Cache (opt-in since Next 15:
force-cache,next.revalidate, tags) - Database / upstream API
Each layer can serve the request and stop it from reaching the next. Invalidation has to target the right layer: revalidateTag purges the data cache, and HTTP headers control browser/CDN behaviour.