Every time we talk about speeding up a WordPress blog, one of the most recommended tips is to set up a CDN (Content Delivery Network). Setting up a CDN for the first time sounds like rocket-science, but really, you can easily set up MaxCDN within a few minutes.
Here I’m sharing a quick guide on how you can set up MaxCDN with the WP Fastest Cache plugin.
MaxCDN is one of the most recognized and most popular CDN services. They have been in the market for a long time, and most of the popular blogs I know are using MaxCDN.
If you don’t know about CDN and its benefits, you should read the following post:
Setting up a Content Delivery Network (MaxCDN in this case) on your blog requires you to do a few things:
- Set up a “Pull Zone” from MaxCDN.
- Add a CNAME record to your domain.
- Set up a CDN linker plugin.
By doing this, your site will be way faster than it was before, as all the files will now be served from the server nearest to your visitors.
Also, your server load will go down by a great extent. Since most WordPress sites are hosted on shared hosting like HostGator, Bluehost, DreamHost, etc., it’s always a good idea to set up a CDN. This will speed up your site’s loading time.
If you are not aware, site speed is one of the ranking metrics which we can’t afford to ignore.
Here is a nice intro video which explains what using MaxCDN can do for your site:
Setting Up A MaxCDN Pull Zone:
Log in to your MaxCDN dashboard and click on “Zones” at the top.
Now go to Pull Zone > Create Pull Zone.
Here we need to add a few values:
- Name: Use your domain name.
- Origin Server URL: Enter your domain name with “http(s)://”.
- EX: http://shoutmetech.com
- Custom CDN name: Use cdn.domain.com (replace “domain.com” with your domain). You can also use something else instead of “cdn” like files.domain.com.
- Label: Give a label to your CDN Zone. This will be useful when you are configuring CDN for multiple sites. Keep it unique to your domain name.
- Compression: Put a check mark here.
So by the end, your setup should look like this:
Click on “+Create”.
It will take about 3 minutes to configure the new Pull Zone.
Afterward, the page will refresh automatically to give you a CNAME record which you need to add into your domain manager. You can always get this detail later by clicking on Manage Zones > Pull Zones.
So my final details are:
Additionally, you should click on the “SEO” tab & “Enable” the “Canonical Header” option.
Configure CNAME Settings to Serve CDN Files from Sub-domain:
Now, all you need to do is login to your domain manager, and under your domain DNS management, click on “CNAME” and add a record for cdn.domain.com (or whatever you called it) to point it to the CDN URL. This may sound technical, but it’s quite easy to do, and it will not take more than 5 minutes to finish.
Click on Zone > Pull Zones > Manage in front of the Pull Zone you just created. Add “cdn” or “files” or anything you would like to use for the custom domain.
In my case I’m using files.shoutmetech.com.
Now the final step is to create a CNAME record:
GoDaddy users can refer to this guide.
Click on “Add Record” and now you have successfully added the CNAME record.
If you find it hard to do for your domain registrar, ping your domain’s technical support and ask them to add the CNAME record as provided by MaxCDN.
Since I’m using CloudFlare, my CNAME propagation happened in real-time. In many cases, CNAME updates may take up to 48-72 hours, so you need to wait until your CNAME is propagated. You can check the status of your CNAME record by adding your CNAME here. EX: files.shoutmetech.com
Once the CNAME changes are reflected, we can go ahead and enable CDN in the WordPress Fastest Cache plugin.
Setting up WP Fastest Cache Plugin to use MaxCDN:
We are done setting up a Pull Zone on the MaxCDN dashboard, and we have also updated the CNAME record to use MaxCDN.
Now, the only thing left is to set up the plugin to use the CDN. If you haven’t yet, go ahead and download the WP Fastest Cache plugin.
- Log in to your WordPress dashboard.
- Click WP Fastest Cache Options.
- Click on the “CDN” tab.
Click on “Next” & on the next page, select the type of files which should be served by the CDN:
Click on “Next” & finish the set up part on the WordPress dashboard.
Click on “Save Changes” and clear your cache. Now, check your site’s load time and source code to see where images are getting served from.
- Earlier your images’ location would be: http://domain.com/wp-content/***
- After CDN implementation: http://cdn.domain.com/***
Here are some FAQs:
Q) What will happen to previously uploaded files? Will all previously uploaded files will be uploaded on the MaxCDN server automatically, or do I need to do something?
A) You set up a Pull Zone, which means MaxCDN will automatically pull all of your content from your server. So there is no uploading to be done.
Q) What will happen if I decide to remove the CDN after a while?
A) If you disable the CDN, there will be no issues. As MaxCDN (when using a Pull Zone) pulls all the data from your server in the background, MaxCDN will be up to date. Although, if you ever edit an already existing file, let’s say replacing an image, the cache will need to be cleared on the CDN in order for the file to update on the CDN. So if you disable the CDN in future, your site will be working like the way it was before, but without the benefits of a CDN.
So in a nutshell, using a CDN on your blog will give you an extra advantage of faster loading.
Translation: Your readers will be more happy.
How many of you are using a Content Delivery Network on your WordPress blog? If you are trying to set one up and are stuck somewhere in between, do let me know and I’ll be happy to help you along.
If you’ve found this tutorial useful and informative, don’t forget to share it!