Bird
0
0

Consider the header: Cache-Control: no-cache, max-age=3600. What issue does this combination present?

medium📝 Debug Q7 of 15
Rest API - Caching Strategies
Consider the header: Cache-Control: no-cache, max-age=3600. What issue does this combination present?
AThe <code>no-cache</code> directive overrides <code>max-age</code>, making <code>max-age</code> ineffective.
BThe header syntax is invalid because <code>no-cache</code> cannot be combined with <code>max-age</code>.
CThe response will never be cached due to conflicting directives.
DThe <code>max-age</code> value is ignored and the response is cached indefinitely.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze no-cache

    This directive requires caches to revalidate before reuse, regardless of freshness.
  2. Step 2: Analyze max-age=3600

    This sets the freshness lifetime to 3600 seconds.
  3. Step 3: Understand interaction

    Because no-cache forces revalidation, the max-age freshness period is effectively ignored.
  4. Final Answer:

    The no-cache directive overrides max-age, making max-age ineffective. -> Option A
  5. Quick Check:

    Does no-cache force revalidation despite max-age? Yes [OK]
Quick Trick: No-cache forces revalidation, ignoring max-age freshness [OK]
Common Mistakes:
MISTAKES
  • Believing the header is syntactically invalid
  • Assuming max-age takes precedence over no-cache
  • Thinking the response will never be cached at all

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes