Bird
0
0

You set Cache-Control: max-age=60 but clients still fetch new data every time. What is the likely mistake?

medium📝 Debug Q14 of 15
Rest API - Caching Strategies
You set Cache-Control: max-age=60 but clients still fetch new data every time. What is the likely mistake?
AThe client does not support caching headers.
BThe max-age value should be in milliseconds, not seconds.
CThe resource URL is missing a file extension.
DThe server is sending <code>no-cache</code> header overriding max-age.
Step-by-Step Solution
Solution:
  1. Step 1: Check for conflicting headers

    If the server sends a no-cache directive, it forces clients to revalidate or fetch fresh data despite max-age.
  2. Step 2: Understand max-age units and client support

    max-age is in seconds, and most clients support caching headers, so these are unlikely causes.
  3. Final Answer:

    The server is sending no-cache header overriding max-age. -> Option D
  4. Quick Check:

    no-cache overrides max-age [OK]
Quick Trick: Check for no-cache header overriding max-age [OK]
Common Mistakes:
MISTAKES
  • Confusing seconds with milliseconds for max-age
  • Blaming client support without checking headers
  • Assuming URL format affects caching

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes