Bird
0
0

A client sends If-Modified-Since: Tue, 09 May 2023 10:00:00 GMT but the server always responds with HTTP 200 OK and full data, ignoring the header. What is the likely error in server handling?

medium📝 Debug Q14 of 15
Rest API - Caching Strategies
A client sends If-Modified-Since: Tue, 09 May 2023 10:00:00 GMT but the server always responds with HTTP 200 OK and full data, ignoring the header. What is the likely error in server handling?
AServer does not check If-Modified-Since header before sending data
BServer sends wrong Last-Modified date format
CClient sent If-Modified-Since header incorrectly
DServer is missing Content-Type header
Step-by-Step Solution
Solution:
  1. Step 1: Understand expected server behavior

    The server should compare If-Modified-Since with resource's Last-Modified and respond 304 if not changed.
  2. Step 2: Identify why server always sends 200 OK

    If server ignores the header and always sends full data, it likely does not check the If-Modified-Since header properly.
  3. Final Answer:

    Server does not check If-Modified-Since header before sending data -> Option A
  4. Quick Check:

    Ignoring If-Modified-Since means always 200 OK [OK]
Quick Trick: Server must check If-Modified-Since to send 304 [OK]
Common Mistakes:
MISTAKES
  • Blaming client for server ignoring header
  • Thinking wrong Last-Modified format causes 200 OK
  • Confusing Content-Type header with caching headers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes