nfs-need-for-speed.jpg

In last post, I told you about Content Delivery Networks and how to use them along with WordPress. Although, now I can suggest that one should certainly use Content Delivery Network as I’ve experienced the change in speed myself! Yesterday, I implemented CDN on this blog and the notice is considerable. The pages that used to take around 9 seconds to load are now loading in about 5 seconds. That’s a decent amount of difference! Now, I would tell you some of the questions that I had in my mind and I’m sure that you will be having them too -

Is it a costly affair?

Content delivery networks are considered to be costly, however surprisingly they are not. Most of the CDN providers run on Pay as you go pricing model and that lets you take control of things. In order to run the test, I signed up with MaxCDN, they have a fantastic offer – they are giving away 1 TB for $ 10. Of course, this is a trial run and a customer will be charged near about $100 for the next 1 Tb. Anyway, I’m not trying to promote any CDN provider, I went for MaxCDN for couple of reasons -

1. It was cheaper than other CDN providers.
2. It has been referred by Mashable, Joost de Valk, W3 Total Cache and I think that was more than enough for me.
3. 1 TB will run for months, there is no monthly payment, so I don’t have anything to lose.

Is it really hard to setup the CDN?

I wasn’t sure about this answer because there wasn’t anyone to tell me that how should I go about it. However, while playing with it – I realized that it is way to simple to setup the CDN. Of course, it would have been a nightmare without the W3 Total Cache. I just don’t have enough words for the praise of this plugin, still I would try to sum up in 2 words – Simply Marvelous!

So what’s the procedure?

I did the setup on MaxCDN and therefore, I would mention the steps for MaxCDN and W3 Total Cache settings only. If you plan to use any other CDN then you may have to refer to their support. I’m assuming that most of the CDN providers will have similar options only. Anyway, here’s how I completed the task -

1. Create a Pull Zone on CDN provider. In this (screenshot) most of the settings are generic, the only place where I got confused was Origin Server URL section. Anyway, I used the following settings and created the pull zone.

maxcdn-pull-zone.jpg

2. Asked WPWebhost to change the CName record as asked by MaxCDN. In many cases, Cname can be changed by you only, however WPWebhost doesn’t give the direct option to its users. However, support team was pretty quick in making the change. After the change, I waited for about 10-12 hrs for propagation. I tried to check http://cdn.blogdesignstudio.com and once I saw the whole website load without issues, I thought that it must be the right time to make changes in W3 Total Cache settings.

3. In the General Tab of W3 Total Cache, make sure that CDN should be enabled and the type should be selected as Origin Pull (mirror) [as shown in the screenshot]

cdn-settings.jpg

4. In the CDN Settings tab of W3 Total Cache, you can configure various options related to what you want to use through CDN and what exactly you want to serve using your own web host. What I changed was just one value; ensure that you need to just put the value of Custom CDN Domain (of the first screenshot) in “Replace Default Hostname With”. Here’s the screenshot of what I have -

cdn-settings2.jpg

That’s it! I just saved the settings and everything was working neatly for me. If you get decent traffic and want to ensure that your blog loads faster than others, then you should surely use a CDN. In the end, I can say that I’m happy with what I’ve achieved – I’ll be posting more optimization techniques to ensure that we also contribute in making the web faster!

Bookmark and Share

What is Content Delivery Network?

A content delivery network or content distribution network (CDN) is a system of computers containing copies of data, placed at various points in a network so as to maximize bandwidth for access to the data from clients throughout the network. A client accesses a copy of the data near to the client, as opposed to all clients accessing the same central server, so as to avoid bottleneck near that server. Content types include web objects, downloadable objects (media files, software, documents), applications, real time media streams, and other components of internet delivery (DNS, routes, and database queries). [via Wikipedia]

Well, I’m sure it sounds alien to some of you. However, I can try and simplify this for you. Let’s take an example – You upload a 2 Mb file on a server that is located in United States, one of your visitor comes to the website from UK and at the same time another from US only. Who’ll get the faster download speed of that file? Of course, it’ll be the US guy. That is how a normal scenario runs. In CDN, a normal file is replicated on multiple servers (shown as middle servers in the image below) placed across the world. So, if a UK guy will be trying to access the same MP3 file, then he’ll get it delivery through UK server only and that will considerably reduce the page load speed.
cdnetwork.jpg

[Image credit - netdna]

Should we use CDN for a blog?

As we found out that CDN helps in reducing the speed. However, the question is that is the speed difference considerable enough? There have been many bloggers who have done their tests and found huge difference in the speed. Joost de Valk found out that his blog pages started loading in 2 sec. as compared to 7 seconds prior CDN’s application.

Well, that certainly sounds effective! Other than that, Dave Ward gives us a tip where we should use Google’s CDN based hosted javascript libraries to improve the blog page load speed. Other than that, Yahoo also suggests website owners to use CDN to improve the page load speed. Well, this only means that it makes sense to use CDN. Now, the big question arises -

How to use CDN with WordPress?

Of course, if you just want use the Google’s CDN based Javascript library then Dave Ward’s link will be more than enough for your help. However, if you want to make proper use of CDN, you’ll have to shell out some money from your pocket. Thankfully established companies like Amazon, MaxCDN, RackSpace and various others offer CDN services, you can always choose the one that suits your pocket.

Once you’ve decided the CDN provider, then you can use its power with the help of W3 Total Cache -

W3 Total Cache improves the user experience of your blog by improving your server performance, caching every aspect of your site, reducing the download time of your theme and providing transparent content delivery network (CDN) integration.

[Click the image for bigger version]

So, as you can see with the help of W3 Total Cache you can easily make use of power of CDN’s and it should certainly help in improving the page load speed. Are you going to apply CDN on your WordPress blog?

Bookmark and Share