Deliver Content Through Amazon CloudFront CDN Services
CloudFront is the Content Delivery Network (CDN) from AWS. It is a delivery service used by businesses to distribute their static and dynamic content to the users with low latency (time it takes to load the first byte of the object), high transfer speeds and with minimum costs.
Amazon CloudFront helps to speed up distribution of your content like your HTML, CSS and image files to end users. It integrates with the other Amazon Web Services, like Amazon Simple Storage Service (Amazon S3), Amazon Elastic Compute Cloud (Amazon EC2), Amazon Elastic Load Balancing, and Amazon Route 53. It also works with the other non AWS origin servers which stores the original versions of your files.
Step 1. Configuration setup for CloudFront to deliver content:
- Configure your Origin Servers (these are locations where the original objects/files are stored). It is from here that CloudFront gets your files for distribution from the edge locations all over the world.
- Your origin server can be either an Amazon S3 or the HTTP server. If your media files are distributed over the Internet, then the server hosting it could be running on an EC2 instance.
- If you’re media is an on demand file distributed using the Adobe Media RMTP protocol, then it must be stored in the Amazon S3.
- Upload the files called as the objects to the origin servers. The objects typically include images, media files and web pages.
- Create a distribution configuration in the CloudFront, where you specify from which origin server, the files should be distributed when the user makes a request. You can additionally maintain logs for all the requests that are made.
- CloudFront sends your distribution’s settings to all of its edge locations (a collections of servers in geographically dispersed data centers where CloudFront caches copies of your objects).
Additional configuration which you can make for content delivery in the CloudFront are specifying the time duration for which the objects will be cached in the edge locations. The default is 24 hrs, before it expires. The minimum expiration time is 0 seconds, with no maximum limit being set.
Step 2. Deliver content through CloudFront
The following steps occur when the user makes a request for the objects.
- User makes a request for the object (an image or html page) from the website or an application.
- DNS (Domain Name Service) routes the request to the nearest CloudFront edge location based on time latency, for distribution.
- The edge location first checks for the requested file in its cache. If it’s available, CloudFront sends it back to the user. If it’s not available, then CloudFront take up the following actions:
- It looks up the distribution configuration and forwards the request to applicable origin server (either S3 bucket or the HTTP server). The origin server returns back the file.
- The CloudFront sends back the file to the user and simultaneously stores a copy in the edge location for the next time it’s requested.
Finally, CloudFront also confirms that the edge location has the latest version of the file, after the default 24 hrs edge cache time, or the expiry time specified in the distribution. If it doesn’t have it, then the origin server sends back the latest version.
Salient features of CloudFront
- Commonly used to delivery both pre-recorded files (audio and video), live events and progressive download of on-demand media files.
- Deliver entire website’s content or web applications.
- Distribute application software or large files
- Cost effective as you pay only for the content that you deliver.
- Fast data transfer through the use of edge locations around the world, leading to better performance.
- Simple setup which allows you to distribute your content through the AWS Management console easily.
- Reliable, elastic and globally available for content distribution through edge locations all over the world.
For more information on how you can implement Amazon Cloud Services for your business, please write to us on firstname.lastname@example.org or call us at +91-80-4110-5555.