Improve User Experience of Website Serving Static Files on EC2 Instances

Avoid Serving EC2 Instances for Static File Delivery

Prev Question Next Question

Question

A website runs on EC2 Instances behind an Application Load Balancer.

The instances run in an Auto Scaling Group across multiple Availability Zones and deliver several static files stored on a shared Amazon EFS file system.

The company needs to avoid serving the files from EC2 Instances every time a user requests these digital assets. What should the company do to improve the user experience of the website?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - B.

AWS Documentation mentions the following about the benefits of using CloudFront:

Amazon CloudFront is a web service that speeds up distribution of your static and dynamic web content, such as .html, .css, .js, and image files to your users.

CloudFront delivers your content through a worldwide network of data centers called edge locations.

When a user requests content that you're serving with CloudFront, the user is routed to the edge location that provides the lowest latency (time delay), so that the content is delivered with the best possible performance.

If the content is already in the edge location with the lowest latency, CloudFront delivers it immediately.

For more information on AWS CloudFront, please visit the following URL on page 3 under the section "Accelerate Static Website Content Delivery":

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html

The glacier is not used for frequent retrievals.

So.

Option A is not a good solution.

Options C & D will also not help in this situation.

Option A: Moving the digital assets to Amazon Glacier is not a suitable solution for improving the user experience of the website. Amazon Glacier is a low-cost storage service designed for long-term data archiving and backup, and it is not intended for frequently accessed files. Retrieving files from Amazon Glacier can take several hours, making it unsuitable for serving static files to users who expect a quick response time.

Option B: Caching static content using CloudFront is the recommended solution for improving the user experience of the website. CloudFront is a content delivery network (CDN) that caches content in edge locations around the world, reducing the latency and improving the performance of the website. By configuring CloudFront to cache static files stored on the Amazon EFS file system, the company can serve the files directly from the edge locations, without relying on the EC2 instances every time a user requests these digital assets. This results in a faster response time for users, lower server load, and cost savings.

Option C: Resizing the images so that they are smaller can improve the website's performance to some extent, but it may not be sufficient to meet the company's needs. While smaller images require less bandwidth and faster to load, they may still need to be served from the EC2 instances, causing high server load and slow response times during high traffic periods.

Option D: Using reserved EC2 instances is not relevant to the question, as it does not address the issue of serving static files from EC2 instances every time a user requests these digital assets. Reserved instances are a billing option that allows companies to reserve EC2 capacity for one or three-year terms at a discounted price, which can be a cost-saving measure for companies with predictable workloads.