Topic 1 Question 881
2 つ選択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?
Set the CloudFront default TTL to 2 minutes.
Set a default TTL of 2 minutes on the S3 bucket.
Add a Cache-Control private directive to the objects in Amazon S3.
Create an AWS Lambda@Edge function to add an Expires header to HTTP responses. Configure the function to run on viewer response.
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.
ユーザの投票
コメント(17)
- 正解だと思う選択肢: AE
AE. By default, each file automatically expires after 24 hours, but you can change the default behavior in two ways:
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.
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
👍 8BBR012024/05/02 - 正解だと思う選択肢: 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.
👍 7MatAlves2024/09/21 - 正解だと思う選択肢: 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
👍 5ug56c2024/06/12
シャッフルモード