Recall & Review
beginner
What is validation-based caching in REST APIs?
Validation-based caching is a technique where the server tells the client if the cached data is still valid using validators like ETag or Last-Modified headers, avoiding sending the full data again.
Click to reveal answer
beginner
What does the ETag header do in validation-based caching?
ETag is a unique identifier for a specific version of a resource. The client sends it back in If-None-Match header to ask if the resource changed. If not, the server replies with 304 Not Modified.
Click to reveal answer
beginner
How does the Last-Modified header help with validation-based caching?
Last-Modified tells when the resource was last changed. The client sends this date in If-Modified-Since header. If the resource is unchanged, the server responds with 304 Not Modified.
Click to reveal answer
beginner
What HTTP status code indicates that cached data is still valid?
The HTTP status code 304 Not Modified means the cached data is still valid and the server does not resend the resource body.
Click to reveal answer
beginner
Why is validation-based caching better than no caching?
It saves bandwidth and speeds up responses by letting clients reuse cached data when it hasn't changed, while still ensuring data freshness by validating with the server.
Click to reveal answer
Which HTTP header is used by the client to ask if the cached resource has changed using ETag?
✗ Incorrect
The client sends the ETag value in the If-None-Match header to check if the resource has changed.
What response status code does the server send if the cached resource is still valid?
✗ Incorrect
304 Not Modified tells the client the cached resource is still valid and no new data is sent.
Which header tells the client when the resource was last changed?
✗ Incorrect
Last-Modified header contains the date/time when the resource was last updated.
What does the client send in the If-Modified-Since header?
✗ Incorrect
The client sends the date of the cached resource in If-Modified-Since to check if it is still fresh.
Why use validation-based caching instead of no caching?
✗ Incorrect
Validation-based caching saves bandwidth and speeds up responses by reusing cached data when valid.
Explain how validation-based caching works in REST APIs using ETag and Last-Modified headers.
Think about how the client asks the server if cached data is still fresh.
You got /5 concepts.
Why is the 304 Not Modified status code important in validation-based caching?
Consider what happens when the server confirms data hasn't changed.
You got /4 concepts.