A high-traffic static website is hosted on Amazon S3 with a CloudFront distribution that currently has a default TTL of 0 seconds. The company wants to add caching to improve performance but must ensure stale content is not served for more than a few minutes after a deployment. Which combination of caching methods should a solutions architect implement? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Set the CloudFront default TTL to 2 minutes., Add a Cache-Control max-age directive of 24 hours to the objects in Amazon S3. On deployment, create a CloudFront invalidation to clear any changed files from edge caches..
Why this is the answer
To balance caching for performance with rapid content updates, a multi-layered approach is best. Setting the CloudFront default TTL to 2 minutes ensures that content is cached at the edge for a short period, improving performance for frequently accessed items while limiting the window for stale content. Adding a Cache-Control: max-age=24h directive to S3 objects allows browsers and CloudFront to cache content for a longer duration, reducing origin requests. However, to prevent stale content from being served for 24 hours after a deployment, a CloudFront invalidation must be performed for changed files. This clears the edge caches immediately, ensuring users receive the latest content. Setting a default TTL on the S3 bucket is not a direct caching mechanism for CloudFront or browsers. A Cache-Control: private directive prevents caching by shared caches
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed