A retail company hosts a promotional web application on AWS. The static product catalog images are stored in an Amazon S3 bucket, and an Amazon CloudFront distribution is deployed to serve these images to global users. During a marketing campaign, the company observes a massive spike in S3 data transfer and API request costs, and users experience increased latency. A review of the CloudFront configuration reveals that the cache behavior for the images has the Minimum TTL, Maximum TTL, and Default TTL all set to 0 seconds. Which action should the solutions architect recommend to resolve this issue and optimize performance?
- Configure the CloudFront cache behavior with positive TTL values, such as a Default TTL of 86400 seconds, to allow the CDN to cache the images at edge locations.Cevap
- BKeep the CloudFront TTL settings at 0 seconds to ensure immediate updates, and deploy an Amazon ElastiCache cluster to cache the static image files.
- CTransition the product images in the Amazon S3 bucket to the S3 Standard-Infrequent Access (S3 Standard-IA) storage class to optimize request costs.
- DAssociate an AWS WAF web ACL with the CloudFront distribution and configure a rate-limiting rule to block excess requests to the catalog images.
Cevap
Configure the CloudFront cache behavior with positive TTL values, such as a Default TTL of 86400 seconds, to allow the CDN to cache the images at edge locations.
Configuring positive TTL values (such as a Default TTL of 86400 seconds) enables CloudFront to cache the static product catalog images at edge locations. Subsequent requests from users will be served directly from the nearest Edge cache rather than going to the S3 origin bucket. This reduces both S3 API call charges and data transfer costs, while significantly lowering latency for global end-users.
Adım Adım Çözüm
Anahtar Kavram
CloudFront Caching Behaviors and Time-To-Live (TTL) Configuration