A company hosts a content-heavy financial news website on AWS using an Application Load Balancer (ALB) and an Auto Scaling group of Amazon EC2 instances as the origin. To reduce latency for its global audience, the company configured an Amazon CloudFront distribution. However, during peak traffic, the EC2 instances experience high CPU utilization due to a massive volume of requests for static images and stylesheets, causing slow page loads. A solutions architect reviews the CloudFront configuration and finds that the cache behavior for static assets has the Minimum TTL, Default TTL, and Maximum TTL all set to 0. Which configuration change should the solutions architect implement to resolve the performance issue on the origin EC2 instances?
- AKeep the TTL values at 0 in CloudFront to ensure content freshness, but enable CloudFront Origin Shield to cache the static assets at a centralized regional layer.
- BMigrate the static assets to an Amazon Elastic File System (EFS) volume mounted on all EC2 instances, and configure Provisioned Throughput to handle the high IOPS demands, while leaving the CloudFront TTL settings at 0.
- Modify the static assets cache behavior to set the Minimum, Default, and Maximum TTLs to non-zero values, allowing CloudFront to serve the static content from edge caches without forwarding validation requests to the ALB.Cevap
- DMove the static assets to an Amazon S3 bucket, and route all data transfer from the EC2 instances to the S3 bucket through a NAT Gateway to ensure low-latency delivery to CloudFront, while keeping the CloudFront TTL settings at 0.
Cevap
Modify the static assets cache behavior to set the Minimum, Default, and Maximum TTLs to non-zero values, allowing CloudFront to serve the static content from edge caches without forwarding validation requests to the ALB.
Modifying the cache behavior for static assets to use non-zero TTL values allows Amazon CloudFront to cache static files at edge locations. Once cached, subsequent requests from users are served directly from the edge cache, eliminating the need to forward validation requests to the origin Application Load Balancer and significantly reducing origin CPU utilization.
Adım Adım Çözüm
Anahtar Kavram
Configuring CloudFront TTL values to enable effective edge caching and reduce origin request load.
Tahmini Süre:1m 30s