Grokking the Modern Frontend System Design Interview
0% completed
Exercise: Classify a Cached Response
HTTP Caching and CDNs sent Basket's product list with max-age=60, stale-while-revalidate=300. For 60 seconds after it is stored, the cache uses the list without asking, and for the next 300 seconds it shows the stored list at once while it revalidates in the background. After that, the cache must wait for the origin before it shows anything.
The Task
Write cacheState(ageSeconds, maxAge, staleWhileRevalidate), which returns what a cache may do with a stored response.
- `ageSeconds
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%