Bird
0
0

Which of the following is the correct syntax to set a Cache-Control header that caches content for 120 seconds?

easy📝 Syntax Q3 of 15
Rest API - Caching Strategies
Which of the following is the correct syntax to set a Cache-Control header that caches content for 120 seconds?
ACache-Control: maxage=120
BCache-Control: max-age=120
CCache-Control: max_age=120
DCache-Control: max-age:120
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct Cache-Control syntax for max-age

    The correct syntax uses 'max-age' with an equals sign and no spaces: max-age=120.
  2. Step 2: Identify incorrect syntax options

    Options with underscores, missing hyphens, or colons instead of equals are invalid.
  3. Final Answer:

    Cache-Control: max-age=120 -> Option B
  4. Quick Check:

    max-age uses hyphen and equals sign [OK]
Quick Trick: Use 'max-age=number' with hyphen and equals sign [OK]
Common Mistakes:
MISTAKES
  • Using underscore instead of hyphen
  • Using colon instead of equals sign
  • Omitting the equals sign

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes