Last Updated on December 28, 2022 by Steve
Amazon CloudFront CDN
This article will help you setup a CDN for your WordPress site, 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.
Global Scaled Network for Fast Content Delivery
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
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.
– 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:
Create a new Distribution
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
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
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
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
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.
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.
Subscribe To Our Newsletter
Be the first to know about our latest posts, tips, tricks, promotions, sales and tutorials on WordPress! Delivered to your inbox once a week, no spam!