No doubt WordPress is a superb publishing platform and used by beginners to professionals. Even the big ones use this awesome CMS. To further improve the performance, use a caching plugin like WP Super Cache with MaxCDN. This is one of the most popular plugin at WordPress plugins library. If you’re already using this plugin, then here’s step-by-step guide to install and setup WP Super Cache with MaxCDN. MaxCDN is a popular content delivery network provider.
Why Use WP Super Cache with CDN
WP Super Cache is a caching plugin that serve static files to your visitor’s and thereby improving the loading time and performance of your site. This is a very popular plugin trusted by many WordPress users. WP Super Cache helps improve the user experience of your WordPress site by speeding up website loading time, caching files, compressing pages with gzip and an added feature to use content delivery network (CDN). Using CDN definitely has got its advantages like improved website performance, faster load times and reduced server load. The functionality of CDN is already integrated with WP Super Cache. We just need to enable CDN support and do proper settings.
Configuring WP Super Cache with MaxCDN
We’ll be using MaxCDN, as a CDN provider for this tutorial. These steps may vary if you’re using another CDN provider. So now, let’s get started. Visit MaxCDN’s site and click on Signup Now. Currently they are running a promotion that gives you 1TB of CDN bandwidth for one year for $39.95.
- After purchasing, go ahead and sign in to your MaxCDN account.
- You will be able to see MaxCDN Dashboard. Click on Manage Zones button and then click on Create Pull Zone.
On this next page, you will need to fill out necessary information. In this image below, you can see all the fields filled out.
Here’s an explanation of each of the fields and what should you enter in those fields.
- Pull Zone Name: Enter name of this zone. This needs to be at least 3 characters long (no special characters or spaces)
- Origin Server URL: Enter full URL of your WordPress site. Don’t forget to include “http://” and the trailing slash (/) at the end of the URL.
- Custom CDN Domain: This is the URL you want to use for your CDN. E.g. files.technostarry.com. Basically you are pointing all the content that you want to be pulled from the CDN to this location. This step is optional but for branding purposes, you can follow this step (Don’t include any www or http in this URL)
- Label: Enter a description for your newly created pull zone
- Compress: Its a better idea to checkmark this box. This will enable compression and save the usage of bandwidth.
Before proceeding, check all the fields again. Click on Create. Now you will see a screen that will give you a new URL for your CDN. For now, just note down this URL. The next step would be to create a CNAME record that points to this CDN URL.
NOTE: If you’ve skipped adding a custom CDN domain in above step, then you don’t need to create a CNAME record from cPanel. Such users can directly configure WP Super Cache. Follow the below process only if you have added a custom CDN domain.
Login to your cPanel (also known as hosting control panel). The URL to login to cPanel will be something like “yoursite.com/cpanel”. Login and then scroll down to the Domains section. Click on Simple DNS Zone Editor.
The next screen would look somewhat complicated. Don’t worry, its not that complicated. You’ll see Add a CNAME Record and two fields in that section.
The two values that are required to be filled are:
- Name: Enter the prefix/first part of your custom domain. This would be what you have written in MaxCDN in “Custom CDN Domain”. Refer the below image, you will see: files.technostarry.com. That’s because I have files as my CDN domain name. You just need to enter “files” and the rest of the URL will be automatically filled when you navigate to the next field.
- CNAME: This will be URL provided to you by MaxCDN when you created that pull zone. This would look something like this: zone.company.netdna-cdn.com
Finally click on Add CNAME Record button. Good going. We have successfully created a CNAME record for MaxCDN pull zone. Now comes the really easy part to configure WP Super Cache plugin.
Configuring WP Super Cache for CDN
If you’ve not installed this plugin, then do so now. Install and activate WP Super Cache.
Open WP Super Cache settings and click on CDN tab. Only two settings need to be configured here. Firstly checkmark Enable CDN Support and then enter the Off-site URL. This off-site URL will be the “Custom CDN Domain” which you entered in MaxCDN. Refer below image for more information.
There’s no need to configure any other settings for now. If you’re advanced user, then you can configure “Include directories” and “Exclude if substring”. Finally click on “Save Changes”.
Remember, till now we have not enabled caching. Go to Easy tab, click on Caching On and then click on Update Status.
Thus, this will enable caching on your site. If you want to configure other settings for WP Super Cache, then do so and save the settings. It’s time to check if the CDN is active on your site or not. To check this, load your site and check the image URLs. Images should be served from the CDN subdomain rather than your site’s actual domain. Here’s an example:
http://www.technostarry.com/wp-content/uploads/2011/02/logo.png
will be replaced with
http://files.technostarry.com/wp-content/uploads/2011/02/logo.png
If you are not able to see this change, then “Delete Cache” from WP Super Cache settings and hard refresh (F5) your site’s home page.
With this step, we finish the process to enable caching and CDN support for WP Super Cache.
The steps we performed at a glance:
- Create a Pull Zone from MaxCDN
- After creating a Pull Zone, you will get a URL. Note down that URL.
- Create a CNAME from your cPanel. Click on “Simple DNS Zone Editor” from your cPanel and create a CNAME record. (Optional)
- The last step would be to enable CDN support and type in the “off-site URL” in WP Super Cache settings.
Video Tutorial on Setting up WP Super Cache and MaxCDN
Using WP Super Cache is the easiest way to setup a CDN. Some may still think why should they use CDN. CDN works with your existing webhost, decreases server load and increases site performance. Images and other required files will be served with CDN, this would reduce server load and improve overall site performance. Go ahead and give a shot to MaxCDN. This is an affordable CDN as it costs just $39.95 for a whopping 1TB bandwidth.
Tips for MaxCDN
How to clear CDN cache?
That’s easy. Login to your MaxCDN account, from the Dashboard click on “Manage” for a particular site which you want to clear/delete CDN cache. From here, click on “cache”. Now you will see a section: “Purge all cache from edge servers”. Click on Purge button. This will purge all the files/data from the CDN. This is useful when you have made any change in your site and it is not getting reflected in the site.
How to enable/disable compression for MaxCDN
Login to your MaxCDN account, from the Dashboard click on “Manage”. Now click on “settings” and here you can find a checkbox to enable GZip compression for certain file types. Just checkmark this box to enable compression or remove checkbox to disable compression. It’s recommended to enable compression.
Can I see reports for which files consume more CDN bandwidth
Yes, MaxCDN offers complete reporting feature. Just login and click on “View Reports” button from navigation to view a complete reporting which includes:
- Transfer per day overview
- Cache hits overview
- Nodes hit overview
- Popular files overview
You can also change report period from this page.
If you have any questions, feel free to ask in the comments section below.
Greg says
Thanks Saqib
After a nightmare with W3Total Cache and Maxcdn,I set up trusty old super cache again.A)it is easier and B)it does not alter the cache files so much
Hlowever I notice that my pull zone does not seem to be pulling images,video
Is there something I am missing or do I require another cdn plugin like simple CDN to push images and css,jkavascript files to maxcdn
Regards
Greg
Saqib says
No, you do not require any another plugin for this. Can you check settings in WP Super Cache > CDN > Include directories. It should be “wp-content” written in here. If this doesn’t work, then check this tutorial again, perhaps you may have missed a step.