Q32 — AWS SAA-C03 Ch.15
Question 32 of 100 | ← Chapter 15
Q1132. A company runs a website that serves static and dynamic content by using several Amazon EC2 instances that are in an Auto Scaling group.The company uses PHP to develop dynamic content. The current architecture includes an Application Load Balancer (ALB) that directs traffic to instances in the Auto Scaling group.Users report that website performance is degrading as the number of website users increases. The company needs to improve the performance of the website. The company creates an Amazon CloudFront distribution to serve content and sets an Amazon S3 bucket as an origin.Which additional steps will meet these requirements?
- A. Copy the static content to the S3 bucket. Migrate the dynamic content to a CloudFront function.
- B. Copy the static content to the S3 bucket. Configure the existing ALB as a second origin to serve the dynamic content. ✓
- C. Copy the static content to the S3 bucket. Migrate the dynamic content to a Lambda@Edge function.
- D. Copy both the static and dynamic content to the S3 bucket.
Correct Answer: B. Copy the static content to the S3 bucket. Configure the existing ALB as a second origin to serve the dynamic content.
Explanation
To improve the performance of the website while using Amazon CloudFront and an S3 bucket for serving content, the best additional steps are:B. Copy the static content to the S3 bucket. Configure the existing ALB as a second origin to serve the dynamic content.Explanation:Static Content in S3: By copying static content (like images, CSS, JavaScript) to the S3 bucket, you can leverage CloudFront to cache and deliver this content closer to users, reducing latency and improving load times.Dynamic Content via ALB: Configuring the existing Application Load Balancer (ALB) as a second origin allows CloudFront to route requests for dynamic content (generated by your PHP application) to the ALB. This setup maintains the benefits of load balancing while still optimizing the delivery of static content.Why Other Options Are Not Suitable:A: Migrating dynamic content to a CloudFront function is not suitable because CloudFront functions are intended for lightweight request/response transformations, not for serving dynamic content generated by a backend application.C: While using Lambda@Edge can optimize dynamic content delivery, it adds complexity and may not be necessary if the ALB is already handling dynamic requests effectively. This could also introduce latency if not properly configured.D: Copying both static and dynamic content to the S3 bucket is not practical, as dynamic content must be generated by the application running on EC2 instances. S3 is not designed for dynamic content generation.Thus, option B provides the best approach to enhance website performance while efficiently handling both static and dynamic content.