Recall & Review
beginner
What is the purpose of the
Cache-Control header in HTTP responses?The
Cache-Control header tells browsers and other clients how to store and reuse the response. It controls caching behavior like how long to keep the data or whether to cache it at all.Click to reveal answer
beginner
Explain what an
ETag header does in HTTP responses.An
ETag is a unique identifier for a specific version of a resource. It helps clients check if the resource has changed since the last request, enabling efficient caching and conditional requests.Click to reveal answer
intermediate
What does the directive
Cache-Control: no-cache mean?It means the client must revalidate with the server before using a cached copy. The cached response can be stored but must be checked for freshness before reuse.
Click to reveal answer
intermediate
How does the client use the
If-None-Match header with ETag?The client sends
If-None-Match with the ETag value it has. The server compares it to the current ETag. If they match, the server replies with 304 Not Modified, saving bandwidth.Click to reveal answer
beginner
Why are
Cache-Control and ETag headers important for REST APIs?They improve performance by reducing unnecessary data transfer and server load.
Cache-Control manages how responses are cached, and ETag helps detect changes to resources efficiently.Click to reveal answer
What does the
Cache-Control: max-age=3600 header instruct the client to do?✗ Incorrect
The
max-age=3600 directive tells the client to consider the cached response fresh for 3600 seconds (1 hour) before checking with the server again.Which header is used by the client to tell the server the version of the resource it has cached?
✗ Incorrect
If-None-Match is sent by the client with the ETag value to ask the server if the resource has changed.What response status code does the server send if the resource has not changed when using ETag validation?
✗ Incorrect
The server sends
304 Not Modified to tell the client the cached version is still valid.If a response has
Cache-Control: no-store, what does it mean?✗ Incorrect
no-store means the response must not be stored in any cache.Which header helps reduce bandwidth by avoiding sending unchanged resources?
✗ Incorrect
ETag allows the server to tell the client if the resource has changed, avoiding resending unchanged data.Describe how
Cache-Control and ETag headers work together to improve API performance.Think about caching rules and how the client checks if data changed.
You got /5 concepts.
Explain the difference between
Cache-Control: no-cache and Cache-Control: no-store.Focus on whether caching is allowed or not.
You got /4 concepts.