My blog is running on a blazing fast Litespeed-powered server which is located in London, but because most of my visitors are from the US (check out this cool infographic!), I always wanted to setup CDN to speed things up for them too. A CDN can offer tremendous WordPress performance improvements and by utilizing the W3 Total Cache plugin you optimize WordPress from it’s core.
Since there wasn’t any related documentation available, Dediserve was very kind to offer me a free first month on their CDN service to test things out.
What is a CDN
A CDN is a global network of caching servers and smart DNS routing that delivers your content and media to your users from the closest possible location. The result is the fastest possible load times, better Google rankings and less load on your servers!
When US visitors view my blog, images are served from the UK, making it a long way from the visitor to the server. By implementing a CDN, edge servers located all around the world serve those images from the nearest location to the visitor. Dediserve is running on the OnApp CDN engine, and has over 60 locations all around the world at the time of writing.
Let’s get started – Setup the WordPress CDN resource
First of all, in order to setup CDN for your website, you’ll need access to your DNS records. I’ll cover the process with cPanel, but it should be as easy with any other hosting control panel, otherwise just ask your host to add the records to your zone.
I’m assuming you’ve already ordered your Dediserve CDN service so from within the Client Area, navigate to CDN, and click on Add new resource.
On the next page, specify the WordPress CDN hostname (eg. cdn.yourdomain.com), the origin domain (eg. www.yourdomain.com), select the Edge Groups which you want to cache your data and click on Create CDN Resource. I’m just using the Global option there, but you can select anything according to your needs. For example if you only have visitors from the US, and your server is located in LA, you can create a CDN resource for USA Central, and another one for USA East Coast.
I’ve repeated the same steps 2 times more, to create media1.georgetasioulis.com and media2.georgetasioulis.com to better parallelize downloads across hostnames.
Add the CNAME records
If you’ve got cPanel just continue reading, otherwise skip this part and either use your control panel’s DNS functionality, or contact your host to add the CNAME for you.
Now we’ll just wait for the DNS changes to propagate around the web. This can take anywhere from a few minutes to 12-24 hours, depending on the TTL configuration of your DNS records.
Configure W3 Total Cache
Click on Save all changes, head over to the General tab and click on Empty all caches and you’re done!
Implementing a WordPress CDN solution is very easy, and offers a huge speed improvement especially on users on different continents than the one your webserver is located. My front page now loads in 2s (from all 3 checkpoints) according to Pingdom Tools Full Page Test compared to 4s (from Amsterdam) and 5-6s (from the two USA checkpoints) before.
Dediserve also offers very competitive CDN pricing, charging a flat monthly fee of 4,95EUR plus 0,05EUR per GB. That’s 3-4 times cheaper than other Pay as you Go CDN providers like MediaTemple or SoftLayer (0.15/GB and 0.20/GB respectively).
Thanks for reading, if you were looking for a CDN solution for your WordPress blog, I highly recommend Dediserve, and in case you come up with any issues feel free to post a comment here (or you can always contact Dediserve’s top notch Support department :))