What Is A CDN And How It Can Speed-Up Your Site


CDN stands for Content Delivery Network and to put it quite simply, it's a collection of interconnected web servers distributed across the globe. The intention of this infrastructure is to serve the visitors of a website from a web server nearby (hence much faster) instead of the main web server which could be located thousands miles away.

To give you a clear understanding of this concept, below you can see a picture of how content is distributed from your web server when you don't use a CDN for your website:




In other words a visitor coming from e.g., South Africa or Australia, would face increased page load time due to the distance, the propagation delay and the latency introduced. On the other hand if you use a CDN for your website, your visitors would be served according to the below:






A picture is a thousand words they say, so I think that the concept and the benefits of it, are visible. Of course when you use a CDN you don't offload your entire website to the servers of a CDN provider, but only the static assets such as images, javascripts, css, etc. So when a visitor requests a page there are two streams of data that work in parallel (instead of one stream requesting the entire content from your host's web server).

These streams are: One with your host's web server (that delivers the actual content) and one with the CDN server that delivers the static assets. This also means that the HTTP requests to your host's web server are decreased which in turn means that the long distance part of the equation is now lighter in bandwidth demand than what it used to be.

If you think that integrating a CDN to your website is expensive or difficult to set-up, you are wrong in both cases. There are a number of CDN providers out there (some better than the others) and it's up to you to choose which one suits you best. The prices for 1TB of bandwidth are, on average, around $20 (quite affordable) and for most websites this could last for about a year.

Regarding the set-up, again it's quite easy because you can do it using the W3 Total Cache that I mentioned earlier. Once you select a CDN provider, you will also find very easily instructions on how to set-it up in W3 Total Cache. In most cases it's a matter of 2-3 minutes (end-to-end) to integrate a CDN to your website and enjoy the benefits of it.

Let me know if you have any problems in general or with a specific CDN provider. I have tested quite a few.



Join the Discussion
Write something…
Recent messages
Pobman Premium
I would not suggest most people run with W3 Total Cache, unless your server is setup right you will not see all the improvements from this plugin and you can actually make things worse. If you install it and you only have options for Disk caching, i.e. no APC etc. then I would just jump ship to Super Cache which pretty much works out of the box.

Running with the CDN though is a massive improvement for most people, I now run most sites with static content on cloudfront and the difference is out of this world.

FYI Cloudfront have added Sydney Australia to their CDN... makes them a winner in my book!

Nice guide though.
Reply
Viterbi Premium
I agree: W3 Total Cache, works even better with APC. For those who don't know, APC stands for Alternative PHP Caching and it's an opcode running on the server side which offers a more efficient caching model. In other words, in some hosts you cannot enable it and you have to use the Disk Caching option in W3 Total Cache. For those cases, I fully agree, it's better to use WP Super Cache as your caching solution.

As far as the CDN and CloudFront is concerned, I also think it's one of the best CDN providers around.

Thanks for the comment Pobman!
Reply
Denisara Premium
smush it doesnt appear to work. it does nothing if I 'mass smush' and if I do them one at a time (and I have 364 pics) it times out. any suggestions? here is the error message I am getting: Automatic smushing has been disabled temporarily due to an error. Operation timed out after 20071 milliseconds with 0 bytes received

i tried a few more pics to "smush" and now they show up "BLANK" how do i get them back? this does NOT work
case in point:
http://bonestrivia.com/bones-season-eight-begins/bones-season-eight

this is one pic "smushed" out of about 12 that i tried this on. how do you reverse this ??????

i guess i have to redo that work completely if I want pictures to show UP
Reply
Pobman Premium
smush does work... some of the time.. the problem is the service is totally overloaded and Yahoo clearly dont care to improve things... it works like 1:10 times it would seem... a shame.

However other than getting the error I have never actually had an issue with it damaging a site.
Reply
Viterbi Premium
Sometime Yahoo's server gets overloaded from users doing the same thing as you do. The reason is that Smush.it sends a COPY of your image to Yahoo's server -> It optimizes this copy -> And then downloads it to your website. Next time you try it, it should be fine.

Regarding the problem with the blank picture, I also never had any issues and I also cannot find any similar incidents online. It's very safe, especially because of the way it's working (described above: copy is sent to server, optimized and then downloaded). Even if the process get's stack in the way, your original will stay intact.
Reply
Pobman Premium
There are other plugins which do similar things, though they all seem to require certain resources to be installed on your server which makes them unlikely to work for those on shared hosting.

If you need to 'fix' a whole site and the bulk change tool is not working then using the multiple upload tool at smush.it is almost as easy. Just FTP all your images down, smush and upload. The advantage here is you do get to check each image first. Thinking back to the problem of SmushIt breaking images I have now and then had issues with PNG and transparency...

A lot of people will just rely on the CDN though, because at the speed the CDN works at even large images come down lightning fast. This of course is not solving the problem, just going around it.
Reply
Denisara Premium
funny, I was told that W3 Total Cache is a mistake to use unless you get like over 10k visitors per month by either Jay, Kyle or Carson...among others. The rest of what you say to do does not make sense to a newb such as myself but thanks for the article...maybe it will help someone else
Reply
Viterbi Premium
W3 Total Cache is a really complicated plugin and you have to do your homework if you want to start playing with the advanced options it provides.

I also agree with the opinion that W3 Total Cache might perform even better in more popular sites (sites receiving more visitors). For less popular sites, WP Super Cache could be more efficient and easy to use.

Bottom line: Each site is different and you can test both options (or even other ones as well) to see what works best for you. The point here is that your website would be far more efficient and optimized if you integrated a caching solution to it (whatever that is).

P.S. I tried to make this training as "newb-friendly" as possible :-)
So please let me know where you need support and I'll do my best to help!
Reply
Viterbi Premium
Thank you Roger!
Reply
morlandroger Premium
WOW this is very comprehensive! Will come back to it and look at some of my sites again with a view to speeding up load times. Thanks for this
Reply
Top