Bird
0
0

A client sends If-Modified-Since: Wed, 10 May 2023 10:00:00 GMT but the server's resource has no Last-Modified header. What is the expected server behavior?

medium📝 Debug Q7 of 15
Rest API - Caching Strategies
A client sends If-Modified-Since: Wed, 10 May 2023 10:00:00 GMT but the server's resource has no Last-Modified header. What is the expected server behavior?
ARespond with 304 Not Modified
BRespond with 400 Bad Request
CIgnore the header and send 200 OK with full resource
DRespond with 204 No Content
Step-by-Step Solution
Solution:
  1. Step 1: Understand missing Last-Modified header

    If the server does not provide Last-Modified, it cannot compare modification dates.
  2. Step 2: Server response

    The server ignores If-Modified-Since and sends full resource with 200 OK.
  3. Final Answer:

    Ignore the header and send 200 OK with full resource -> Option C
  4. Quick Check:

    No Last-Modified means no conditional response [OK]
Quick Trick: No Last-Modified means always send full resource [OK]
Common Mistakes:
MISTAKES
  • Sending 304 without Last-Modified
  • Responding with error status
  • Sending 204 No Content incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes