Question

Difficulty: HardHigh-Performing Content Delivery and Caching Solutions

A global logistics corporation runs a package tracking portal on AWS. The application serves static content (images, CSS, and JS files) stored in an Amazon S3 bucket, and dynamic tracking updates via an Application Load Balancer (ALB) that routes to an Amazon ECS cluster. During peak operations, the ECS cluster experiences high CPU utilization due to repetitive queries for identical, fast-changing tracking data. A solutions architect must design a high-performing content delivery and caching solution that minimizes latency for users globally while reducing the read load on both S3 and the ECS cluster. Which architecture should the solutions architect implement to meet these requirements?

  1. Configure an Amazon CloudFront distribution with two cache behaviors. Route the path pattern for static assets to the Amazon S3 origin with a caching-optimized policy. Route the API path pattern to the ALB origin with caching enabled and a short Time-To-Live (TTL), using the package ID query string parameter as part of the cache key.Answer
  2. B
    Configure an Amazon CloudFront distribution with two cache behaviors. Route the path pattern for static assets to the Amazon S3 origin with the minimum, maximum, and default TTL set to 0. Route the API path pattern to the ALB origin with caching enabled, and deploy Amazon ElastiCache for Redis behind the ECS cluster to cache tracking queries.
  3. C
    Configure Amazon Route 53 with a Latency Routing policy to distribute static asset requests directly to S3 buckets in multiple AWS Regions. For dynamic tracking queries, configure Amazon DynamoDB Accelerator (DAX) to cache responses directly at the ALB network layer.
  4. D
    Configure Amazon CloudFront to distribute the static assets from the S3 origin. For dynamic tracking queries, route the traffic from the ALB through a NAT Gateway in the public subnet, and enable VPC flow log caching to intercept and cache the API responses at the network boundary.

Answer

Configure an Amazon CloudFront distribution with two cache behaviors: one routing static assets to the S3 origin with a caching-optimized policy, and another routing API requests to the ALB with caching enabled for a short duration using query string parameters.
The correct architecture uses Amazon CloudFront to optimize content delivery for both static and dynamic contents. By defining two cache behaviors, the solutions architect can apply a long, caching-optimized TTL for static assets stored in S3, and a short TTL (e.g., a few seconds) for the dynamic API requests directed to the ALB. Including the tracking package ID query parameter in the cache key ensures that requests for the same package are served from the cache, while requests for different packages generate distinct cache entries, reducing load on ECS.

Step-by-Step Solution

1
Analyze the workload characteristics
The application serves two distinct traffic types: static web assets (images, CSS, JS) from S3, and dynamic queries (tracking updates) from an ECS backend via ALB.
Different traffic types require different caching policies to optimize hit ratios and prevent stale data.
2
Establish the edge caching layer using Amazon CloudFront
A single CloudFront distribution can target multiple origins (S3 for static assets and ALB for the API) using path-based behaviors.
Using CloudFront ensures global low-latency delivery by caching content at AWS edge locations close to users.
3
Configure the cache behavior for static assets
Map static paths to the S3 origin and apply a caching-optimized policy (long TTLs).
Static assets rarely change, so maximizing cache retention minimizes read requests to the origin S3 bucket.
4
Configure the cache behavior for dynamic tracking updates
Map API paths to the ALB origin. Enable caching with a short TTL (e.g., several seconds) and configure the package ID query string parameter to be included in the cache key.
A short TTL prevents stale tracking updates while absorbing high-concurrency spikes for identical package queries, drastically reducing CPU load on ECS.

Key Concept

Multi-tier caching using Amazon CloudFront cache behaviors for S3 and ALB origins to optimize performance and reduce backend load.
Estimated Time:2m 0s
Rate this question