Amazon CloudFront

Sruti Samatkar
Analytics Vidhya
Published in
4 min readFeb 27, 2021

--

Amazon CloudFront

Amazon CloudFront is a content delivery web service(CDN). It integrates with other AWS Cloud services to give developers and businesses an easy way to distribute content to users across the world with low latency, high data transfer speeds, and no minimum usage commitments.

Amazon CloudFront Basics:

There are three core concepts that you need to understand to start using CloudFront: distributions, origins, and cache control.

1.Distributions: To use Amazon CloudFront, you start by creating a distribution, which is identified by a DNS domain name. To serve files from Amazon CloudFront, you simply use the distribution domain name in place of your website’s domain name; the rest of the file paths stay unchanged.

2. Origins: When you create a distribution, you must specify the DNS domain name of the origin — the Amazon S3 bucket or HTTP server — from which you want Amazon CloudFront to get the definitive version of your objects (web files).

3. Cache-Control: Once requested and served from an edge location, objects stay in the cache until they expire or are evicted to make room for more frequently requested content.

AWS CloudFront Advanced Features:

Dynamic Content, Multiple Origins, and Cache Behaviors: Serving static assets, such as described previously, is a common way to use a CDN.

  • An Amazon CloudFront distribution, however, can easily be set up to serve dynamic content in addition to static content and to use more than one origin server.
  • You control which requests are served by which origin and how requests are cached using a feature called cache behaviors.
  • A cache behavior lets you configure a variety of Amazon CloudFront functionalities for a given URL path pattern for files on your website.
  • For example see below figure One cache behavior applies to all PHP files in a web server (dynamic content), using the path pattern *.php, while another behavior applies to all JPEG images in another origin server (static content), using the path pattern *.jpg.
Delivering static and dynamic content

How AWS CloudFront Delivers the content?

  1. The Client access a website and requests an object to download.
  2. The DNS routes user request to AWS CloudFront.
  3. AWS CloudFront connects to its nearest edge locations in order to serve the user request.
  4. At edge location, AWS CloudFront looks for the requested cache file and if it is not there it compares the requirements with the specifications and shares it with the respective server.
  5. The server responds by sending the files back to the CloudFront edge locations.
  6. Then CloudFront shares the file or request with the client.

Benefits of AWS CloudFront:

Uses of CloudFront
  1. Cost-Effective
  2. Time-Saving
  3. Content Privacy
  4. Highly Programmable
  5. Geo-Targeting
  6. Accelerates static website content delivery.
  7. Serve on-demand on live streaming videos.

Companies using CloudFront

Companies using CloudFront
  • Jio Saavn: It uses Amazon CloudFront to deliver 15 petabytes of audio and video to its subscribers globally.
  • Sky News: It uses the service in order to unify the content for faster distribution to subscribers.
  • Discovery Communication: It uses the service for delivering API, Static assets, and dynamic content.
  • Tv1EU: The service helps in improving latency and performance which results in the fastest delivery of content.

Conclusion:

AWS CloudFront is a globally distributed network offered by AWS which securely delivers content to the end-users with a high transfer speed and low latency. We saw how AWS CloudFront delivers the content. It has various benefits and uses like serving on-demand live streaming videos, encrypting specific fields throughout system processing, and accelerating static website content delivery. Many popular media and streaming platforms use AWS CloudFront.

--

--