Bird
0
0

A client sends a request with header If-Modified-Since: Wed, 10 May 2023 10:00:00 GMT. The server's resource was last modified at Wed, 10 May 2023 09:00:00 GMT. What will the server respond?

medium📝 Predict Output Q4 of 15
Rest API - Caching Strategies
A client sends a request with header If-Modified-Since: Wed, 10 May 2023 10:00:00 GMT. The server's resource was last modified at Wed, 10 May 2023 09:00:00 GMT. What will the server respond?
A304 Not Modified with no body
B200 OK with full resource
C404 Not Found
D500 Internal Server Error
Step-by-Step Solution
Solution:
  1. Step 1: Compare modification dates

    The resource was last modified before the date in If-Modified-Since header.
  2. Step 2: Determine server response

    Since resource is not modified after the date, server responds with 304 Not Modified and no body.
  3. Final Answer:

    304 Not Modified with no body -> Option A
  4. Quick Check:

    Resource older than If-Modified-Since = 304 [OK]
Quick Trick: If resource older than date, respond 304 [OK]
Common Mistakes:
MISTAKES
  • Sending full resource when not modified
  • Confusing 404 with modification status
  • Assuming server error on date mismatch

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes