System Design · Middle · Question 8 of 75
What caching layers exist between the user and the database?
- ✓Correct answer: Memory, HTTP cache, Service Worker, CDN, server cache
- 2Only the browser cache - the other layers are obsolete
- 3Only the CDN - browsers don't cache API responses
Explanation
Each layer offloads the next and reduces latency: client data cache (TanStack Query), HTTP cache via headers, SW for offline, CDN at the network edge, Redis and render cache on the server. The hard part is consistent invalidation.