Bird
0
0

Why might a server choose to use both Cache-Control: max-age=0, must-revalidate and an ETag header together?

hard📝 Conceptual Q10 of 15
Rest API - Request and Response Format
Why might a server choose to use both Cache-Control: max-age=0, must-revalidate and an ETag header together?
ATo force clients to always download fresh content ignoring cache
BTo allow clients to cache content but verify freshness before use
CTo disable caching and prevent any client storage
DTo specify the content type and encoding of the response
Step-by-Step Solution
Solution:
  1. Step 1: Analyze max-age=0 and must-revalidate

    This combination means cached content is stale immediately and must be revalidated before use.
  2. Step 2: Understand ETag role

    ETag provides a way to check if the cached content matches the server's current version.
  3. Step 3: Combine effects

    Together, they allow caching but require clients to confirm content freshness, saving bandwidth if unchanged.
  4. Final Answer:

    To allow clients to cache content but verify freshness before use -> Option B
  5. Quick Check:

    max-age=0 + must-revalidate + ETag = cache with freshness check [OK]
Quick Trick: Use max-age=0 + must-revalidate + ETag for cache validation [OK]
Common Mistakes:
  • Thinking this disables caching completely
  • Confusing with content type headers
  • Assuming clients ignore must-revalidate

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes