Exam SAA-C03 All QuestionsBrowse all questions from this exam
Question 881

A company is hosting a high-traffic static website on Amazon S3 with an Amazon CloudFront distribution that has a default TTL of 0 seconds. The company wants to implement caching to improve performance for the website. However, the company also wants to ensure that stale content is not served for more than a few minutes after a deployment.

Which combination of caching methods should a solutions architect implement to meet these requirements? (Choose two.)

    Correct Answer: A, E

    To meet the requirements of improving performance and ensuring that stale content is not served for more than a few minutes after a deployment, setting the CloudFront default TTL to 2 minutes ensures that the content is cached briefly, which boosts performance. Adding a Cache-Control max-age directive of 24 hours to the objects in Amazon S3 and using a CloudFront invalidation to clear any changed files post-deployment ensures that the stale content does not persist for too long and is quickly refreshed after updates.

Discussion
BBR01Options: AE

AE. By default, each file automatically expires after 24 hours, but you can change the default behavior in two ways: 1. To change the cache duration for all files that match the same path pattern, you can change the CloudFront settings for Minimum TTL, Maximum TTL, and Default TTL for a cache behavior. 2. To change the cache duration for an individual file, you can configure your origin to add a Cache-Control header with the max-age or s-maxage directive, or an Expires header to the file. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html#expiration-individual-objects

xBUGxOptions: AC

Add a Cache-Control Private Directive to Objects in Amazon S3 (Option C): By setting the Cache-Control header to private for objects in the S3 bucket, you control caching behavior. The private directive indicates that the content is intended for a single user and should not be cached by intermediate proxies or CDNs. This helps prevent stale content from being served to multiple users. Additionally, consider using other Cache-Control directives (e.g., max-age, no-cache, no-store) as needed.

ug56cOptions: AE

If your minimum TTL is greater than 0, CloudFront uses the cache policy’s minimum TTL, even if the Cache-Control: no-cache, no-store, and/or private directives are present in the origin headers. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html

ScheldonOptions: AC

Answer (AC) Per table on URL https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html#expiration-individual-objects answer E is incorrect because if we will change cache-control max-age to 24h it will means that customer browser will cache web for 24h and customer want to be sure that it will be not longer then few min. Expires header (answer D) from my understanding can be used only on full folder of web not as lambda function which will reply to customer reqeusts. We are setting Default TTL for CloudFront (answer A) not on S3 (answer B) and it will say CloudFront to cache web for 2min.

Scheldon

Adding Cache-control private (answerC) will work per customer wish but only if we will add them to the objects which are changed very often or if we will set minimum TTL. In the 1 situation User Browser will not store files which we designate to be often changed and mentioned files will be downloaded every time from origin. In the 2 situation, Cloud front will cache web files for min TTL time but customer browser will not store them. Taking all that in to account I would go with AC

EdricHoangOptions: AC

If the content still keep client's cache in 24h, its wrong (answer E)

Nm55569Options: AE

"However, the company also wants to ensure that stale content is not served for more than a few minutes after a deployment." After a deployment

LinuslinOptions: AE

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html#expiration-individual-objects https://stackoverflow.com/questions/43343759/confused-with-minimum-maximum-and-default-ttl-in-cloudfront

02ffe1cOptions: DE

Since it don’t want to cache more than a minute, A cannot be an answer

kelmryan1

Answer is AE , C would only be on the user browser and would not cache to the cloud front and would be useless