Bird
0
0

You want to optimize bandwidth by using ETags. Which combination of request and response headers correctly implements conditional GET caching?

hard📝 Application Q8 of 15
Rest API - Caching Strategies

You want to optimize bandwidth by using ETags. Which combination of request and response headers correctly implements conditional GET caching?

AClient sends <code>If-None-Match: "etag123"</code>; server responds 304 if ETag matches
BClient sends <code>If-Match: "etag123"</code>; server responds 200 with full body if ETag matches
CClient sends <code>If-Modified-Since: "etag123"</code>; server responds 404 if ETag matches
DClient sends <code>If-Unmodified-Since: "etag123"</code>; server responds 500 if ETag matches
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct header for conditional GET with ETag

    Client uses If-None-Match with ETag to ask server if resource changed.
  2. Step 2: Understand server response on match

    If ETag matches, server returns 304 Not Modified to save bandwidth.
  3. Final Answer:

    Client sends If-None-Match with ETag; server responds 304 if matches -> Option A
  4. Quick Check:

    Conditional GET uses If-None-Match and 304 response [OK]
Quick Trick: Use If-None-Match and 304 to save bandwidth with ETags [OK]
Common Mistakes:
MISTAKES
  • Using If-Match for GET caching
  • Confusing date headers with ETag
  • Expecting 404 or 500 on match

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes