Setting up an Amazon CloudFront CDN: Quick & Easy 2021

Last Updated on July 31, 2021 by Steve

Amazon CloudFront CDN

This article will help you setup a CDN for your WordPress site hosted on Best WordPress Solutions, through Amazon’s CloudFront Service. This will allow browsers to fetch data much faster, as it will be cached on an intermediary server, that is supposed to handle much less requests, hence providing faster delivery times.

What is Amazon 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.

Benefits Include:

Global Scaled Network for Fast Content Delivery

BestWP Banner Ad

Amazon CloudFront is massively scaled and globally distributed. The CloudFront network has 225+ points of presence (PoPs) that are interconnected via the AWS backbone delivering ultra-low latency performance and high availability to your end users.

Security at the Edge

Amazon CloudFront is a highly secure CDN that provides both network and application level protection.

Website Delivery and Security

Amazon CloudFront can speed up the delivery of your websites, whether its static objects (e.g., images, style sheets, JavaScript, etc.) or dynamic content (e.g., videos, audio, motion graphics, etc.), to viewers across the globe. The CDN offers a multi-tier cache by default that improves latency and lowers the load on origin servers when the object is not already cached at the Edge. With granular cache configuration controls, built-in capabilities such as gzip and brotli compression, access to geo-location headers, and edge compute capabilities, customers such as Amazon.com and Reach plc deliver content to millions of viewers.

Configure CloudFront

CloudFront generates a subdomain on cloudfront.net for your distribution, basically representing a dedicated cache server, which will sync with your WordPress site through the use of a cache plugin such as LSCache or WP Rocket, and then start serving content for it.

Pre-requisites:

– Amazon CloudFront account (http://aws.amazon.com/cloudfront/)

With everything in place, let’s assume our website is www.bcwebsite.tk.

The steps to activate your first distribution will be the following:

Amazon CloudFront Create Distribution
Create Distribution

Create a new Distribution

Origin settings

Amazon CloudFront Origin Settings
Origin Settings

1. Set your Origin Domain Name. Eg: library.bcwebsite.tk
Set Origin ID is automatically set to Custom-library.bcwebsite.tk
2. Set Origin Protocol Policy to HTTPS Only (CloudFront will connect to my origin using only HTTPS).

Default cache behavior settings

Amazon CloudFront Cache behavior settings
Cache Behavior Settings

1. Set Viewer Protocol Policy to HTTP and HTTPS
2. Set Object Caching to Use Origin Cache Headers
or choose “Customize” if you want to specify expiry time for objects in the CloudFront cache regardless of Cache-Control headers, through setting Minimum TTL (default 24h).
3. Set Forward Query Strings to NO

Distribution settings

1. Set Price Class.
  If you activate CDN For only Europe and US the cost is smaller. All edge location imply worldwide coverage at higher costs

Amazon CloudFront Distribution Settings
Distribution Settings

2. Set an Alternate Domain Names(CNAMEs) Eg: cache.bcwebsite.tk
3. You can choose to enable logging. For that you would need to create a Bucket in the S3 Console, required to store web server logs. You’ll select that bucket here
4. Set Distribution State to Enabled

Amazon CloudFront Create Distribution
Create Distribution

Finally, click on the Create Distribution button. You will see the status as follows:

A domain name has been generated for your CloudFront distribution: d**************q7.cloudfront.net.

The service is now syncing with your site. The Status will change to “Deployed” once it completes, and that usually takes about 10 minutes. The domain name generated by CloudFront can now be used in cache plugins such as LiteSpeed Cache or WP Rocket to connect to CloudFront Distribution.

Summary

Setting up a content distribution network with Amazon CloudFront is not difficult and inexpensive. Its pretty straight forward if you follow this quick guide.

Hope you found this article helpful. Visit our FAQs or knowledge base for full tutorials and how to articles on WordPress. Existing customers we thank you. Visitors who have not had the privilege of having a Best WordPress Solutions Maintenance or Best WordPress Solutions Shared/VPS Hosting account please consider becoming our customer by selecting one of our WordPress Maintenance Solutions or Shared Hosting / VPS Hosting packages. For those not interested in monthly commitment we do offer solutions with one time payment option. You will not be disappointed.

Author

  • I have been in the information technology field since I left the United States Army over twenty years ago. Skills and experience include a Bachelor's degree in Computer Information Systems with a Specialization in Databases and a Master's in Computer Information Systems Management.

    I fell in love with WordPress over 10 years ago and spend most of my time designing, building and administering WordPress based sites. I am fluent in multiple programming languages including Python, PHP, SQL, Java and C#.

    Have a problem with your site? Do you need a reliable host and a reliable systems administrator to help with your site? I can have your site up, running and simply hand you the keys. No job is too big or too small.  Satisfaction guaranteed or your money back. Visit online store for latest pricing and offerings!

Leave a Comment

%d bloggers like this: