How to Configure CDN with WordPress using Amazon Web Services (AWS)

Configure CDN

If you have a WordPress site, you know the importance of site performance in search engine ranking as well as in customer experience. There are several strategies to optimize the performance of your site and ensure good page load speed. As you know, using a content delivery network is one of the important strategies you can adopt to speed up loading of your pages. A content delivery network (CDN) will ensure that your web content is served from a location closer to the user. In this article, we will provide an overview on how you can configure CDN using Amazon Web Services (Cloudfront) for your WordPress site.

What is Amazon Cloudfront?

Amazon Cloudfront is a service part of Amazon Web Services that helps with your site performance. It makes use of a global network of data centers that will speed up the distribution of content to your users. Basically it will serve dynamic and static content including image files, html, CSS, JavaScript, etc., from a location closer to the user. This will ensure minimum latency in content delivery, and makes sure that your site has good page load speed.

Configure CDN
Amazon Web Services offers a range of services that you can use to manage your website more effectively.

Features

  • Globally distributed through a wide network of data centers to ensure the superior performance of your website.
  • Highly secure with built-in security features such as AWS Shield Standard, AWS Certificate Manager (ACM), etc. It also helps you manage custom SSL certificates without additional costs.
  • Customize the features of the CDN easily with the developer friendly interface of Cloudfront It also offers integrations with other tools and automation interfaces.
  • Access from a single console along with other popular services such as Amazon S3, Amazon Route 53, Amazon EC2, Elastic Load Balancing, and AWS Elemental Media Services.

Advantages of using Amazon Cloudfront

  • It will help you serve static content such as image files, JavaScript, CSS, etc., through the global delivery network and as a result reduces the load on your origin server. This means your users will have a superior experience while accessing your website.
  • Also, it can serve dynamic content faster with features like API Acceleration.
  • You will find different options to stream your video content smoothly. The CDN will cache the media fragments and reduces the load of the server.
  • With superior security features data throughout your network will be encrypted and
  • Data security will be ensured with advanced encryption and by providing access only selected components and services in your technology stack.
  • You will be able to customize the content delivery pattern based on your user behavior, and also can conduct A/B Testing.
  • Software updates will be cost effective and faster, ensuring a better customer experience on your website.
  • Cloudfront is effectively integrated with AWS infrastructure and helps you to use it easily with other services from a single dashboard. You can use Amazon S3, AWS Shield for DDoS mitigation, Elastic Load Balancing, etc. along with it easily.
  • For a WordPress site owner who is using Amazon Services, it is important to understand the process of integrating Cloudfront to WordPress site.

How to integrate Amazon Cloudfront CDN on your WordPress site?

Here is a look at the basic steps to configure CDN using Amazon Cloudfront on your WordPress site.

Step 1

You need to create an account with Amazon Web Services to integrate Cloudfront CDN on your WordPress site. You can create an AWS account for free and use a range of services that are part of it with certain limits.

As part of the plan you will get 50GB of data transfer out and 2 million viewer requests for free each month for the first 12 months for Cloudfront.

Configure CDN
You can sign in to Amazon Web Services for free by entering your credit card information, and can use a range of Free tier services for 12 months.

Step 2

Once you have an AWS account, you can use the AWS for WordPress plugin to integrate Cloudfront with your website.

configure CDN
This plugin helps you configure CDN through Amazon Cloudfront CDN services to your WordPress site.

Install the plugin and activate it.

Step 3

Create AWS credentials to enable the plugin to configure Cloudfront. You will get AWS Access Key and AWS secret key, which you need to enter in the plugin settings page.

Configure CDN
Create your AWS credentials that you need to enter in the plugin settings page to integrate Cloudfront with your WordPress site.

Step 4

Now, you have to access the Cloudfront section from the plugin settings page and specify an alternate domain name for the CDN to operate.  This alternate domain sends your website’s traffic through Amazon Cloudfront.

You can enter the Origin domain name and Cloudfront Alternate Domain name in the fields designated for them. Amazon recommends using ‘www’ in front of your domain name for the Cloudfront alternate domain name. For example, if your origin domain name is mysitename.com, use www.mysitename.com as the alternate domain name. Then you can click the Initiate Setup button.

configure CDN
Enter the origin name and alternate Cloudfront domain name to configure CDN on your WordPress site using AWS.

Step 5

You can use AWS Certificate Manager to create a certificate for your alternate domain name. And you will have to validate this certificate within 72 hours of the request. You can check the status of the SSL certificate on the plugin itself. Once AWS validates the domain and issues the certificate, the plugin will create a distribution that is optimized for WordPress.

Step 6

In the next step, you can make sure that the final link is established by clicking Check status of CloudFront DNS record.

This is almost the final stage of configuring CDN using Amazon Cloudfront

Also make sure to enable Site Acceleration by ticking the checkbox for the same.

Step 7

As a final step, you can verify if the content is served from Cloudfront’s cache. Use the incognito mode of your browser, or open the site using an alternate browser to verify this. Also, you can click the inspect mode of your browser to make sure that the alternate Cloudfront domain name is serving the resources.

configure CDN
You can use the Inspect option of the browser to see if the alternate domain name is serving resources like images to your users.

This way you can use AWS for WordPress plugin to configure CDN on your WordPress site with help of Cloudfront that is part of Amazon Web Services. You can also use this plugin to create audio versions of your blog posts, and create podcasts. It also allows you to translate them into other languages. Amazon Polly, the text-to-speech service can also be used for free as part of the free tier when you sign up. You can synthesize up to 5 million characters for free each month for the first 12 months. Please note, if you want to store Amazon Polly audio files on Amazon S3, you will have to incur additional charges.

You can also view the developer documentation to understand the process of creating the IAM user credentials and more.

Another plugin that you can use to set up Cloudfront CDN is W3Total Cache. It will help you configure CDN using Cloudfront, and you will be able to manage CDN transparently.

Hopefully, this article has provided an overview on CloudFront and how to configure CDN on your WordPress site. If you have a query regarding this, please leave us a comment below.

Further reading

LEAVE A REPLY