Question

Difficulty: MediumHigh-Performing Content Delivery and Caching Solutions

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?

  1. 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.Answer
  2. B
    Keep the CloudFront TTL settings at 0 seconds to ensure immediate updates, and deploy an Amazon ElastiCache cluster to cache the static image files.
  3. C
    Transition the product images in the Amazon S3 bucket to the S3 Standard-Infrequent Access (S3 Standard-IA) storage class to optimize request costs.
  4. D
    Associate an AWS WAF web ACL with the CloudFront distribution and configure a rate-limiting rule to block excess requests to the catalog images.

Answer

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.

Step-by-Step Solution

1
Identify the root cause of the high latency and origin request spike.
The CloudFront distribution is configured with Minimum, Maximum, and Default TTLs of 0 seconds, meaning no caching is happening at edge locations.
When TTL is 0, CloudFront must forward every incoming request back to the S3 origin, negating the benefits of the CDN.
2
Select the appropriate remedy to enable caching for static assets.
Modify the CloudFront cache behavior to use positive TTL values (e.g., Default TTL of 86400 seconds).
This allows CloudFront to store the images at Edge locations, satisfying subsequent requests locally and offloading the S3 origin.

Key Concept

CloudFront Caching Behaviors and Time-To-Live (TTL) Configuration
Rate this question