AWS CloudFront

How AWS CloudFront Helps in Improving the Performance of Content Delivery?

Are you preparing for AWS Certified Solutions Architect Professional certification exam? In this space, we are writing a series of articles on topics which are covered in the Solutions Architect Professional certification exam. In this article, we are explaining one of the important services offered by Amazon web services, which is AWS CloudFront. You can subscribe to our blog for receiving the further updates on this topic.

This topic addresses the High Availability and Business Continuity topic mentioned in the below table and as highlighted in the AWS Solutions Architect Professional certification exam blueprint:

AWS Certified Solutions Architect Professional BluePrint

What is AWS CloudFront?

AWS CloudFront is used as a content delivery service in order to deliver content to the users around the globe via edge locations. Let’s go through some of the core terms of CloudFront.

  • Origin Server – This is used to store the original versions of your files on one or more origin servers. An origin server is the location of the definitive version of an object. Origin servers could be other Amazon Web Services – an Amazon S3 bucket, an Amazon EC2 instance, or an Elastic Load Balancer. You can also have your own custom origin for CloudFront.
  • Distribution – This is the CloudFront aspect which is used to route requests from the user to the edge location to the origin server. There are two types of distributions you can create – web distributions for HTTP/HTTPS and RTMP Distributions for RTMP and its variants
  • Edge Cache – These are points which are located across the globe to reduce the time taken to deliver content to the end users. These caches can be used to hold the recently requested data. If the data is not available at the edge location, it will be requested from the origin server.
  • TTL – Amazon CloudFront lets you configure a Minimum time-to-live (Min TTL), a Maximum TTL (Max TTL) and a Default TTL to specify how long CloudFront caches your objects in edge locations
  • Query String parameters – Query string parameters are often used to return customized content generated by a script running on the origin server
AWS CloudFront CDN
AWS CloudFront CDN

Dynamic Content

AWS CloudFront can also be used to deliver dynamic content. Some of the key aspects while delivering dynamic content are given below:

  • Low TTL’s – Amazon CloudFront uses the expiration period you set on your files (through cache control headers) to determine whether it needs to check the origin for an updated version of the file. If you expect that your files will change frequently, you can set a short expiration period on the file. Amazon CloudFront accepts expiration period as short as 0 seconds.
  • Query String parameters – Query string parameters are often used to return customized content generated by a script running on the origin server. You can optionally configure query strings to be forwarded to the origin servers and be included in the unique identity of the cached object.
  • Forward headers to the origin – You can use Amazon CloudFront to forward all (or a whitelist of) request headers to your origin server. These headers contain information such as the device used by your visitors or the country from which they accessed your content.
  • Protocol detection – You can configure Amazon CloudFront to include the protocol (HTTP vs HTTPS) of your end user’s request as part of the cache key to uniquely identify an object in the cache
  • HTTP Cookies – Amazon CloudFront supports delivery of dynamic content that is customized or personalized using HTTP cookies.

Creating a CloudFront Distribution

Let’s now go through the steps which can be used to create a CloudFront distribution

Step 1: Log in to the AWS console. The first step is to create an origin. Let’s create the origin as an S3 bucket. So, let’s go over to the S3 section first.

create the origin by selecting the S3

Step 2: Next, let’s create a bucket. Click on Create bucket.

create bucket

Step 3: Give a name for the bucket and specify the region. Click on the Next button.

Enter bucket name and details

Step 4: Next when you reach the ‘Set Permissions’ page, ensure that the ‘Everyone’ entity has the Read permission.

Set permission

Finally, you can click on the ‘Create button’ at the bottom of the screen.

Click on create button

Step 5: Next let’s upload an object to the S3 bucket. Go into the bucket and click on the ‘Upload’ button.

Upload an object

Add any simple file to the ‘Upload’ section.

Upload any simple file

Click on the Next button.

In the permission section, ensure that the ‘Everyone’ entity has the Read permission. Then finally click on the Upload button to upload the object.

Set read permission for Everyone

Step 6: Now let’s create out the CloudFront distribution. In the AWS console, go to Networking & Content Delivery -> Cloudfront

Create Cloudfront Distribution

Step 7: Next click on ‘Create Distribution’

Click on Create Distribution

Choose the Web distribution

Choose the Web distribution

Choose the Origin domain name as the democlassnew bucket which was created in the earlier step in the next screen.

Choose the Origin domain name as the democlassnew bucket

You can keep the rest of the settings as they are and click on the Create Distribution button at the bottom of the screen.

No other settings changes and click on Create Distribution

Once the distribution has been created, you will get the details of the distribution. Use the domain name to browse to the distribution.

Distribution details

Important Points to Remember about Cloudfront

Some important points you need to remember about Cloudfront are given below:

  • Amazon CloudFront edge locations can look at the value of the User-Agent header to detect the device type of all the incoming requests. Amazon CloudFront can determine whether the end user request came from a Desktop, Tablet, Smart TV, or Mobile device and pass that information in the form of new HTTP Headers to your origin server.
  • Amazon CloudFront can also detect the country from where the end users are accessing your content. Amazon CloudFront can then pass the information about the country in a new HTTP header to your custom origin server.
  • You can use Amazon CloudFront’s private content feature to control who is able to access your content. This optional feature lets you use Amazon CloudFront to deliver valuable content that you prefer not to make publicly available by requiring your users to use a signed URL or have a signed HTTP cookie when requesting your content.
  • CloudFront can have a custom SSL attached. Custom SSL certificate support lets you deliver content over HTTPS using your own domain name and your own SSL certificate.
  • Amazon CloudFront lets you configure a Minimum time-to-live (Min TTL), a Maximum TTL (Max TTL) and a Default TTL to specify how long CloudFront caches your objects in edge locations.
  • Query string parameters are often used to return customized content generated by a script running on the origin server

Don’t MISS IT: AWS Certified Solutions Architect Professional – Practice Tests(50% Discount)

Bottom Line

In this article, we have explained about AWS CloudFront. AWS CloudFront is used to deliver content to users around the globe via edge locations. So, it is one of the important service provided by the Amazon Web Services (AWS). You will get a number of questions on this topic in your certification exam.

If you are preparing for the AWS certifications exam and looking for any help, put your question below in the comment section below or submit in Whizlabs helpdesk, we will get back to you in no time.

About Pavan Gumaste

Pavan Rao is a programmer / Developer by Profession and Cloud Computing Professional by choice with in-depth knowledge in AWS, Azure, Google Cloud Platform. He helps the organisation figure out what to build, ensure successful delivery, and incorporate user learning to improve the strategy and product further.

0 thoughts on “How AWS CloudFront Helps in Improving the Performance of Content Delivery?”

Leave a Comment

Your email address will not be published. Required fields are marked *


Scroll to Top