Configure W3 Total Cache, MaxCDN and WordPress

by on October 7th, 2010

I will keep it simple and straight. What is CDN? CDN is content delivery network. You can make your website load 10 times faster using CDN. RackSpace, Amazon, MaxCDN and many other provide CDN. I will go with MaxCDN which I have used. You will have to purchase MaxCDN bandwidth package. That’s just bandwidth of 1000 GB in $34 for one year. Use it in one year or whenever you finish it up all by using it, buy more bandwidth. Space is separate. 10GB space is in $10 per month which can be used to upload your heavy files to and to serve those from CDN. Why CDN? Your blog or website will be slow when serving all the pages, JS files and CSS files and images. If you use CDN and configure your blog to serve files from CDN, they will use a temp subdomain for your website and serve certain files from that domain. This will significantly improve your website speed and raise page rank of your website pages (Google checks website pages speed to determine page ranks – this is one factor in determining PR). You don’t need space at MaxCDN unless you intend to move heavy files there e.g. pdf, rar, zip etc.

Its like purchase MaxCDN, add W3 Total Cache plugin and activate it. Get API, ID and the Temporary URL from MaxCDN and configure W3 Total Cache to use MaxCDN network and done. It looks all pain in the *** but its one timer. Set it and forget it. You blog/website will be amazingly faster than before.

The problem is configuring all these three together to make them work for you. Here is how.

MaxCDN guide to configure it with W3 Total Cache

The above guide is not easy to understand. Read on…

You will need W3 Total Cache which has built in facility to configure MaxCDN and it beats WordPress Super cache in this way. W3 Total cache also have some other cool features WP Super Cache does not have. WP Super Cache is also great though.

Configure MaxCDN

Okay! Go to MaxCDN, Purchase the bandwidth package.
Activate account, Login.
Go to Manage Zones.
Pull Zones > Add Pull Zone
Give name, original URL (your site URL), custom CDN domain (if you want to use custom sub-domain name then fill it or leave it blank otherwise e.g. mysitecdn.mysite.com)
Hit create button
Go to Manage Zones > Pull Zones
Select zone you created (manage it)
Copy Temporary URL from there
Manage account > API > Create API
You will get API ID and API key
Write those down

You have got API ID, API Key and Temporary URL from MaxCDN, right.

Configure W3 Total Cache

Go to your blog.
You know how to add plugin, right?
Search and add W3 Total Cache and activate it.
Deactivate WP Super Cache before activating W3 Total cache.

Look at the left side panels. You will spot Performance tab (W3 Total cache Settings). Expand that.
Go to General settings.
Enable all where and whatever you can enable.
Under ‘Content Delivery Network’ select ‘CDN Type’ where you spot MaxCDN + some other crap.
Now come to CDN link in Under Performance.
Second portion is for Configuration of CDN network.
Give it API ID, API key and that weird Temporar URL you got from MaxCDN.
Replace site’s hostname with = Temporary URL you got from MaxCDN or custom record (mycdn.yoursite.com)
Save Changes.
Under ‘Advanced’ there you will spot:
favicon.ico
wp-content/gallery/*
add wp-content/uploads/* below those
(uploads is your folder which stores your uploads at your blog)
Save changes
Click Test NetDNA. It should say ‘Test Passed’.

Okay now you can change that weird temporary URL by adding CNAME record from your host.

Configure Host for Custom DNS

Go to your host.
Go to Manage Domains.
Your site will be listed there and there somewhere will be written DNS
Click that and now you are going to add custom DNS record for your site.
You don’t want to change the current DNS records but you are going to add another custom DNS record.
You will need to fill two fields and select one option as below:

Name: mycdn.yoursite.com
Type: CNAME
Value: that weird Temporary URL which you got from MaxCDN.

Click thumb below for full image.

host cdn configure

It means that your are redirecting that Temporary URL to a friendly subdomain of your website named as mycdn.
Now change that Temporary URL where you used it in W3 Total cache in CDN configuration and put there mycdn.yoursite.com
But this is custom temporary subdomain and it will only work if you game it while adding pull zone in MaxCDN.

Using Custom CDN Domain

When you add new pull zone it will ask you following:

Pull Zone Name: can be any name
Origin Server URL: your site URL
Custom CDN Domain: that custom temporary domain name e.g. mycdn.yoursite.com
Label: can be any
Compression: check option if server supports

There ‘Custom CDN Domain’ URL will be present which you created in your host.

W3 Total cache CDN Data Settings

Now finally open the following URLs in separate windows:

http://www.yourblog.com/wp-admin/admin.php?page=w3tc_cdn&w3tc_action=cdn_export&cdn_export_type=minify
http://www.yourblog.com/wp-admin/admin.php?page=w3tc_cdn&w3tc_action=cdn_export&cdn_export_type=custom
http://www.yourblog.com/wp-admin/admin.php?page=w3tc_cdn&w3tc_action=cdn_export&cdn_export_type=includes
http://www.yourblog.com/wp-admin/admin.php?page=w3tc_cdn&w3tc_action=cdn_export&cdn_export_type=theme

and click start. Let then finish and then close them.

Checking for Changes

If all goes well, you can open your website to see it running faster and the source of pages will reflect that the images, CSS and JS files are coming from subdomain of your website. e.g.

<link rel="stylesheet" href="http://sitename.com/style.css" type="text/css" media="screen" />

becomes

<link rel="stylesheet" href="http://cdn.sitename.com/style.css" type="text/css" media="screen" />

Get CDN

Get MaxCDN

Got it? :D
I know… :)
Read steps carefully and follow…You will go through…
Expert’s advice recommended…
I really do not know why they have made it so difficult. Perhaps because you are linking MaxCDN, WordPress and W3 Total Cache with each other.
I am using CDN at TechMynd. You can check. No Lies.
Ask away in case of confusion, anything related to W3 Total cache and WordPress and MaxCDN or CDN…I will be glad to help.


Share

One Review

  1. bet365 says:

    hello!This was a really outstanding post!
    I come from roma, I was luck to find your website in yahoo
    Also I get a lot in your theme really thanks very much i will come every day