Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam AWS Certified Solutions Architect - Associate SAA-C03 All Questions

View all questions & answers for the AWS Certified Solutions Architect - Associate SAA-C03 exam

Exam AWS Certified Solutions Architect - Associate SAA-C03 topic 1 question 881 discussion

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.)

  • A. Set the CloudFront default TTL to 2 minutes.
  • B. Set a default TTL of 2 minutes on the S3 bucket.
  • C. Add a Cache-Control private directive to the objects in Amazon S3.
  • D. Create an AWS Lambda@Edge function to add an Expires header to HTTP responses. Configure the function to run on viewer response.
  • E. 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.
Show Suggested Answer Hide Answer
Suggested Answer: AC 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
BBR01
Highly Voted 6 months, 3 weeks ago
Selected Answer: 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
upvoted 5 times
...
MatAlves
Most Recent 2 months ago
Selected Answer: AC
You simply can't have A and E in the same approach: "Default TTL applies only when your origin does not add HTTP headers such as Cache-Control max-age, Cache-Control s-maxage, or Expires to objects." C - Cache-Control private directive specifies that the response is intended for a single user and should not be cached by shared caches - it can still be cached, but only on a client device. This combination of steps would provide the best solution for the case. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesDefaultTTL
upvoted 4 times
Sergantus
1 week ago
Setting Cache-Control: private would prevent CloudFront from caching the content entirely, which is not the goal outlined, as it wants to use caching. After some time with updates, the caching performance will degrade for the entire solution as more and more objects get that directive.
upvoted 1 times
...
...
1ba9aa0
3 months, 3 weeks ago
Selected Answer: AC
A-C, Because A-E is not possible following this link: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesDefaultTTL "Default TTL applies only when your origin does not add HTTP headers such as Cache-Control max-age, Cache-Control s-maxage, or Expires to objects."
upvoted 2 times
...
EdricHoang
4 months, 2 weeks ago
Selected Answer: AC
If the content still keep client's cache in 24h, its wrong (answer E)
upvoted 2 times
...
ug56c
5 months, 1 week ago
Selected Answer: 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
upvoted 4 times
...
Nm55569
5 months, 2 weeks ago
Selected Answer: 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
upvoted 3 times
Sergantus
1 week ago
Exactly, it was not outlined that the user shouldn't see the stale content, only that it's not served.
upvoted 1 times
...
...
Scheldon
5 months, 3 weeks ago
Selected Answer: 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.
upvoted 3 times
Scheldon
5 months, 3 weeks ago
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
upvoted 2 times
...
...
Linuslin
6 months ago
Selected Answer: 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
upvoted 2 times
...
02ffe1c
6 months, 2 weeks ago
Selected Answer: DE
Since it don’t want to cache more than a minute, A cannot be an answer
upvoted 1 times
mk168898
4 weeks, 1 day ago
no where in the question did it say 1 minute. You mean more than a few minutes?
upvoted 1 times
...
...
kelmryan1
6 months, 3 weeks ago
Answer is AE , C would only be on the user browser and would not cache to the cloud front and would be useless
upvoted 1 times
...
xBUGx
7 months, 3 weeks ago
Selected Answer: 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.
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...