Rest API - Caching StrategiesWhich of the following is the correct syntax to set a Cache-Control header that caches content for 120 seconds?ACache-Control: maxage=120BCache-Control: max-age=120CCache-Control: max_age=120DCache-Control: max-age:120Check Answer
Step-by-Step SolutionSolution:Step 1: Recall correct Cache-Control syntax for max-ageThe correct syntax uses 'max-age' with an equals sign and no spaces: max-age=120.Step 2: Identify incorrect syntax optionsOptions with underscores, missing hyphens, or colons instead of equals are invalid.Final Answer:Cache-Control: max-age=120 -> Option BQuick Check:max-age uses hyphen and equals sign [OK]Quick Trick: Use 'max-age=number' with hyphen and equals sign [OK]Common Mistakes:MISTAKESUsing underscore instead of hyphenUsing colon instead of equals signOmitting the equals sign
Master "Caching Strategies" in Rest API9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Rest API Quizzes API Documentation - Endpoint documentation structure - Quiz 1easy API Documentation - Schema definitions - Quiz 8hard API Testing and Monitoring - Why testing validates contracts - Quiz 13medium API Testing and Monitoring - API monitoring and alerting - Quiz 15hard Advanced Patterns - Sparse fieldsets (select fields) - Quiz 13medium Advanced Patterns - Resource expansion (embed related data) - Quiz 11easy Caching Strategies - Cache invalidation strategies - Quiz 10hard Caching Strategies - Cache invalidation strategies - Quiz 15hard Caching Strategies - Why caching reduces server load - Quiz 14medium Webhooks and Events - Webhook payload design - Quiz 6medium