Sometimes using a caching plugin alone isn’t enought to get your WordPress page speed to a reasonable level. Fortunately Amazon CloudFront can be used as an easy and affordable way to improve load times considerably.
In this video, I show how to setup a CDN using Amazon CloudFront with about 10 minutes of work.
You will need:
- W3 Total Cache
- Amazon S3 Account (for CloudFront)
- Access to your Domain DNS Editor
Before you start, be sure to run a test on your site at http://gtmetrix.com
to create a point of reference.
- Login to Amazon account
- Click on name in top corner and then click on Security Credentials
- Click Access Keys and copy the Access Key ID
- Click the Show button for Secret Access Key (or retrieve if you already have one). Copy this key.
- Go to WP – Performance – General Settings
- Scroll to section marked CDN Type and select Amazon CloudFront from the Origin Pull area. Now check Enable – Save all settings
- Performance – CDN – Scroll to Configuration
- Enter Access Key ID and Secret Key from Amazon S3
- Click Create Distribution
- Go back to Amazon and navigate to CloudFront console
- You should see the new Distribution in the Distribution List
- Wait until the Status goes from In Progress to Active (10 min or more)
- Click on the “i” icon and then copy the domain that has been assigned in the General tab
- Go to your Cpanel, scroll to Domains section, and select Simple DNS Zone Editor
- Create an alias in the Name field for the CNAME. Ex: cdn.domain.com
- Enter the original URL from CloudFront in the CNAME field then click Add CNAME Record
- Go back to CloudFront and click the “i” button, then edit under the General tab.
- Enter your CNAME into the box labeled “Alternate Domain Names (CNAMEs)” then click the Yes Edit box in the bottom right corner
- Return to W3 Total Cache to the CDN tab
- Add the CNAME that you created in the box “Replace site’s hostname with:” #1. Then Save All Settings
- Click Test CloudFront Distribution and it should turn green
- Enable the settings to be cached and served by the CDN under the General settings area (same screen). Recommended settings are:
- Host attachments
- Host wp-includes/files
- Host theme files
- Host custom files
Save All Settings
Now just refresh your home page and right click to view page source. You should see most of your website files are pointing to your CDN URL.
NOTE: After step #21 it will take another 10 to 15 minutes before the Amazon server has fully deployed. During this time your site will appear broken. RELAX!!! It’ll be fine once the server fully deploys.
Now go check your site at GT Metrix to see how much of an improvement the CDN has made.
Keep up to date with all my SEO training videos here: http://www.youtube.com/playlist?list=PLW5rUlmOefD858qPj6QQ1dG7uUSg-Ag4r
For more How To SEO training videos, subscribe to my YouTube channel: http://www.youtube.com/BennerBradley
Bradley Benner — http://bradleybenner.com