Recall & Review
beginner
What is cache invalidation in REST APIs?
Cache invalidation is the process of removing or updating stored data in a cache when the original data changes, ensuring clients receive fresh and accurate information.
Click to reveal answer
beginner
Explain the 'Time-to-Live (TTL)' cache invalidation strategy.
TTL sets a fixed time period after which cached data expires automatically. After this time, the cache is refreshed with new data from the server.
Click to reveal answer
intermediate
What is 'Cache Busting' and how is it used?
Cache Busting involves changing the resource's URL (like adding a version number or timestamp) so that clients fetch the updated resource instead of the cached one.
Click to reveal answer
intermediate
Describe the 'Cache-Control' header role in cache invalidation.
The Cache-Control header tells clients and proxies how to cache responses, including how long to keep them and when to revalidate, helping control cache freshness.
Click to reveal answer
advanced
What is the difference between 'push' and 'pull' cache invalidation?
Push invalidation actively notifies caches to update or clear data when changes happen. Pull invalidation relies on clients or caches to check and refresh data after a set time or event.
Click to reveal answer
Which cache invalidation strategy uses a fixed expiration time for cached data?
✗ Incorrect
TTL sets a fixed time after which cached data expires automatically.
What does the Cache-Control header NOT control?
✗ Incorrect
Cache-Control does not change the resource URL; it controls caching behavior.
Cache Busting typically involves:
✗ Incorrect
Cache Busting changes the URL (like adding a version) to force clients to fetch fresh data.
Push cache invalidation means:
✗ Incorrect
Push invalidation actively informs caches to update or clear data.
Which strategy relies on clients or caches to check for updates themselves?
✗ Incorrect
Pull invalidation depends on clients or caches to refresh data after some time or event.
Describe three common cache invalidation strategies used in REST APIs and when you might use each.
Think about automatic expiration, URL changes, and active vs passive updates.
You got /3 concepts.
Explain how the Cache-Control header helps manage cache invalidation in REST API responses.
Focus on how HTTP headers guide caching behavior.
You got /3 concepts.