AWS CloudFront

Ranadheer raju D
4 min readApr 29, 2020

--

Hello everyone, in my previous article we have discussed about Regions, Availability Zones and Local Zones. Which will help us to know, what will be the best AZ and Region to deploy our application. But also we should have to know how fast our website is working, so to know that we should have a knowledge on AWS CloudFront service.

Let’s say your running a website, but you donno how fast your website is running ?, with how much speed your sharing of your dynamic and static web content such as .css, .html and image files ? and how securely your delivering the data such as images, videos and applications to users and clients ?. So like that there are so many questions that will come into our mind.

For all the questions that we discussed above, the only best and possible solution is AWS CloudFront.

What is AWS CloudFront ?

Amazon CloudFront is a fast content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with low latency, high transfer speeds, all within a developer-friendly environment. CloudFront is integrated with AWS — both physical locations that are directly connected to the AWS global infrastructure, as well as other AWS services.

To Know how fast your website is working, you can use the CloudFront service. It speeds up the sharing of your dynamic and static web content such as .css, .html and image files to your users. It securely delivers your images, videos, data and applications to users and clients with high transfer speed and low latency, all within a developer-friendly environment.

We have a new concept called edge locations.

How CloudFront works ?

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 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.
  • If the content is not in that edge location, CloudFront retrieves it from an origin that you’ve defined — such as an Amazon S3 bucket, a MediaPackage channel, or an HTTP server (for example, a web server) that you have identified as the source for the definitive version of your content.

How CloudFront speeds up distribution of content ?

CloudFront speeds up the distribution of your content by routing each user request through the AWS backbone network to the edge location that can best serve your content. Typically, this is a CloudFront edge server that provides the fastest delivery to the viewer. Using the AWS network dramatically reduces the number of networks that your users’ requests must pass through, which improves performance. Users get lower latency — the time it takes to load the first byte of the file — and higher data transfer rates.

CloudFront Architecture

Image source: AWS Docs

How you setup CloudFront to deliver content ?

Image source: AWS Docs

Steps to configure CloudFront to deliver your content:

  1. You specify origin servers, like an Amazon S3 bucket or your own HTTP server, from which CloudFront gets your files which will then be distributed from CloudFront edge locations all over the world.
  2. You upload your files to your origin servers. Your files, also known as objects, typically include web pages, images, and media files, but can be anything that can be served over HTTP or a supported version of Adobe RTMP, the protocol used by Adobe Flash Media Server.
  3. You create a CloudFront distribution, which tells CloudFront which origin servers to get your files from when users request the files through your web site or application. At the same time, you specify details such as whether you want CloudFront to log all requests and whether you want the distribution to be enabled as soon as it’s created.
  4. CloudFront assigns a domain name to your new distribution that you can see in the CloudFront console, or that is returned in the response to a programmatic request, for example, an API request. If you like, you can add an alternate domain name to use instead.
  5. CloudFront sends your distribution’s configuration (but not your content) to all of its edge locations or points of presence (POPs) — collections of servers in geographically-dispersed data centers where CloudFront caches copies of your files.

Accessing CloudFront

There are 5 ways to access CloudFront:

  1. AWS Management Console.
  2. AWS SDKs.
  3. CloudFront API.
  4. AWS Command Line Interface.
  5. AWS tools for windows Powershell.

To know more about these individual points, click here.

AWS CloudFront Usecases

  1. Static asset caching.
  2. Live and on-demand video streaming.
  3. Security.
  4. Customizable content delivery with Lambda@edge.
  5. Dynamic content and API acceleration.
  6. Software distribution.

Benefits of AWS CloudFront

  1. Fast and global.
  2. Security at the edge.
  3. Highly programmable.
  4. Deep integration with AWS.

“I have covered everything about AWS CloudFront, I know this is a small article but we can’t elaborate more. Hope everyone got a knowledge on this and if anyone excited to know more about this, feel free to reach out us at any time or comment your queries here. We are always ready to hear you”

Thank you!!!

--

--

Ranadheer raju D

Software Development Engineer | AWS Solution Architect | Piazza Tech Consulting Group