Bird
0
0

When a server receives a request with an If-None-Match header that matches the current ETag, what HTTP status code should it return?

easy📝 Conceptual Q2 of 15
Rest API - Caching Strategies
When a server receives a request with an If-None-Match header that matches the current ETag, what HTTP status code should it return?
A200 OK
B304 Not Modified
C404 Not Found
D500 Internal Server Error
Step-by-Step Solution
Solution:
  1. Step 1: Understand the meaning of matching ETags

    If the ETag in If-None-Match matches the current resource ETag, the resource has not changed.
  2. Step 2: Identify the correct HTTP response

    The server should respond with 304 Not Modified to tell the client to use its cached version.
  3. Final Answer:

    304 Not Modified -> Option B
  4. Quick Check:

    Matching ETag response = 304 Not Modified [OK]
Quick Trick: Matching ETag means send 304 Not Modified [OK]
Common Mistakes:
MISTAKES
  • Returning 200 OK unnecessarily
  • Confusing 404 with caching behavior
  • Using 500 error for ETag matches

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes