Q82 — AWS SAA-C03 Ch.16

Question 82 of 100 | ← Chapter 16

Q1282. A company is building a new web application that serves static and dynamic content from an API. The company wants to minimize latency for users who access the application from around the world.Which solution will meet these requirements MOST cost-effectively?

Correct Answer: A. Deploy the static content to an Amazon S3 bucket. Use an Amazon API Gateway HTTP API to serve the dynamic content. Create an Amazon CloudFront distribution that uses the S3 bucket and the HTTP API as origins. Enable caching for static content.

Explanation

The correct solution must minimize latency globally for both static and dynamic content while being cost- effective. Let's evaluate each option:Correct Answer: A. Deploy the static content to an Amazon S3 bucket. Use an Amazon API Gateway HTTP API to serve the dynamic content. Create an Amazon CloudFront distribution that uses the S3 bucket and the HTTP API as origins. Enable caching for static content.Why Option A is Best:Global Low Latency for Both Content Types:CloudFront (AWS's CDN) caches static content at edge locations worldwide (from S3) for fast delivery. Dynamic content is served via API Gateway HTTP API, which supports low-latency requests (especially when combined with CloudFront's dynamic content acceleration).Cost-Effective:S3 is inexpensive for static storage.API Gateway HTTP API has lower pricing than REST API (cheaper per million calls). CloudFront reduces origin load (S3/API Gateway) by caching, lowering costs.Optimized Caching:Static content is cached at the edge (reducing S3 requests). Dynamic content can use API Gateway caching (if applicable) or CloudFront's TTL settings for semi- dynamic data.Why Other Options Fail:B. Deploy the static content to an Amazon S3 bucket. Provide the bucket website endpoint to users. Use an Amazon API Gateway HTTP API with caching enabled to serve the dynamic content.No CDN for Static Content:Serving static content directly from S3 website endpoint means higher latency for global users (no edge caching).API Gateway Caching Alone Isn't Enough:Dynamic content still lacks global acceleration without CloudFront. C. Deploy the static content to an Amazon S3 bucket. Use two Amazon EC2 instances as web servers. Deploy an Application Load Balancer to distribute traffic. Create an Amazon CloudFront distribution in front of the S3 bucket to cache static content.Unnecessary Complexity & Cost:EC2 instances are expensive (compute, management, scaling) compared to serverless options (API Gateway).ALB adds cost but isn't needed for dynamic API traffic (API Gateway is better). CloudFront only caches static content (dynamic still goes to EC2, missing optimization). D. Deploy the static content to an Amazon S3 bucket. Provide the bucket website endpoint to users. Create an Amazon CloudFront distribution in front of the S3 bucket to cache static content.No Solution for Dynamic Content:This option only handles static content (via S3 + CloudFront). Dynamic content must still be served separately (e.g., via EC2, Lambda, or API Gateway, but this isn't included here).Key Comparison:RequirementOption AOther OptionsGlobal low latency for static content(CloudFront + S3) (B: S3 endpoint; C: Partial; D: Only static) Global low latency for dynamic content(CloudFront + API Gateway) (B: No CDN; C: EC2/ALB; D: Missing) Cost-effective(S3 + HTTP API + CloudFront) (B: No CDN; C: EC2/ALB; D: Incomplete) Simplicity (serverless)(No EC2/ALB) (C: EC2/ALB)Conclusion:Option A is the only solution that:Minimizes latency globally for both static and dynamic content. Uses cost-effective serverless components (S3, API Gateway, CloudFront).Avoids unnecessary infrastructure (EC2, ALB).Final Answer: A