Bird
0
0

What will the server respond if the client sends If-None-Match: "abc123" but the current ETag of the resource is "def456"?

medium📝 Predict Output Q5 of 15
Rest API - Caching Strategies
What will the server respond if the client sends If-None-Match: "abc123" but the current ETag of the resource is "def456"?
AHTTP/1.1 200 OK with full resource
BHTTP/1.1 404 Not Found
CHTTP/1.1 304 Not Modified
DHTTP/1.1 500 Internal Server Error
Step-by-Step Solution
Solution:
  1. Step 1: Compare client ETag with server ETag

    Client's ETag "abc123" does not match current "def456".
  2. Step 2: Determine server response when ETags differ

    Server sends full resource with 200 OK to update client cache.
  3. Final Answer:

    HTTP/1.1 200 OK with full resource -> Option A
  4. Quick Check:

    ETags differ, server sends full data = C [OK]
Quick Trick: Different ETags mean send full resource with 200 OK [OK]
Common Mistakes:
MISTAKES
  • Sending 304 when ETags differ
  • Returning 404 instead of resource
  • Assuming server error on mismatch

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes