Content Delivery Networks – A Comprehensive Guide for WordPress Users

All business owners — without exception — want their website to rise up the search engine rankings and gain as much traffic as possible. And nowadays, in order to rank highly on Search Engine Results Pages (SERPs), websites need to be as fast as possible — which is basically why website loading speeds have become such a big deal lately.

One such step in the right direction in the quest for an ever-faster website — for sites with global audiences — is making use of a Content Delivery Network (or ‘CDN’, for short).

Starting with the basics of what a CDN actually is before moving on to the subject of how to integrate a CDN with WordPress and finishing up by recommending a few of the best CDNs available, let’s get started…

Some Basics About CDNs

In order to explain exactly what a CDN is and how it works, we’ll first need to take a step back a little, since it’s first necessary to understand a few key concepts. Starting with the fact that a web page is actually made up of many individual pieces, loosely called elements, each of which may be quite different to the next, i.e. some will be images, some may be audio or video files, and some will be code based files, such as HTML, CSS and JavaScript files (note: when on a particularly slow internet connection, it’s sometimes even possible to see these individual pieces loading in turn on some websites).

Now, when a user requests a webpage, each of these elements must be located on a server and assembled into a web page (all on the fly, and a lightning speed!). As such, all but the most simply modern web pages don’t actually already exist as preformed things, instead, they’re only created and served up to a user as and when his or her browser makes a specific request to view a particular webpage.

The role of a CDN is to store as many of these aforementioned elements on various different servers located throughout the world in order make them as geographically close as possible to actual people requesting them from the server — the idea being that the shorter the distance the information has to travel, the quicker it arrives.

What’s more, CDNs are also able to compress certain page elements or bundle them together into fewer packages, which results in less back-and-forth between browsers and servers, which, again, leads to quicker load times.

What is a Content Delivery Network?

In summary then, a CDN is a service that stores the static elements of your website (i.e. those elements that never change, such as images, CSS and JavaScript files) on a network of servers located across the globe.

When using a CDN, when a visitor requests a webpage from your website, any static elements within the webpage are served to his or her browser from the server that is closest to his or her actual location.

How a CDN Works - Diagram

(click to enlarge)

Note: for an additional, slightly-broader explanation of what a CDN is, check out this handy infographic from KeyCDN.

The Benefits of Using a CDN

Incorporating a CDN is beneficial in more ways than one:

  • It helps to load the static content of a website site much faster. Servers located geographically closer to the user will serve up static pages, thereby cutting down on hops and round-trips-to-the-server times.
  • The number of connections that a website can make at any one time is limited. When you have content stored on multiple servers, the load gets distributed allowing more live connections.
  • This arrangement can handle sudden bursts or spikes in traffic better. Bottlenecks at the original server will come down.
  • Most service providers offer an additional layer of security to the servers, so any malware attacks are stopped before they reach the server. The security measures adopted by them will include IP cloaking, white & blacklisting, support for SSL and multiple HTTP authentication methods. Even if any one server succumbs to an attack, others are available to ensure the uptime of the website. Any good hosting company is expected to have such security features, but it is pretty much a part of the standard service for a CDN service provider.
  • Speed translates to better user experience. Bounce rates are reduced.
  • Most service providers also guarantee 100% availability, even in cases of power or hardware failures. So downtime on account of disruption in network is almost nil.

What to Look for in a CDN

CDNs generally offer a wide network of servers, easy integration with WordPress and free trial plans. And some even offer free services. While checking out service providers, always keep any unique needs of your website in mind.

  • Bandwidth: The bandwidth and pricing for the bandwidth is one of the most important aspects to check. You should be aware of your own bandwidth requirements and see if the service provider can match it at a reasonable cost. To estimate your bandwidth requirement, you can visit 5cents.cdn. Also, check whether bursting or sudden spikes in traffic is allowed and the rates charged for such bursts. You don’t want unpleasant surprises.
  • Network Quality: The quality of the network can be tested by checking the latency (how long it takes to receive a reply) and bandwidth (the number of bytes received). Time-to-first-byte must be kept to minimum and the bandwidth must be consistent throughout the entire network, for speed will be only as good as the weakest link. This is especially important for a website streaming multimedia content.
  • Availability: The network must always be available. Automatic redirection must be implemented if a server in the network goes down. Most CDN providers guarantee 100% availability. Also check network usage — an overcrowded network is bound to slow down or disrupt your traffic.
  • Coverage: The network service provider must have a strong presence in the area where your audience is concentrated. While proximity of server or point of presence in the geographical area is important, traffic routing is what is critical to speed. So even if there is a server closer to the location you need, it may not do you much good if the routing is done in a roundabout way. Generally, proximity is a reasonable indicator of the route that will be taken for transmission of data.
  • Technology: When a user sends a request to a website, the DNS automatically directs the query to the nearest server based on the location of the user and other details. The CDN must use the latest technology to transmit data reliably and speedily.
  • Monitoring in Real Time: The service provider must monitor the network in real time, especially the last mile. You should not learn it from a user that your website is inaccessible. The provider can capture data from the user’s browser to check bandwidth and latency.
  • Support: 24 X 7 X 365 support is desirable, given that the network may operate across different time zones. Further, integrating a CDN in WordPress can get quite technical, and you may have to fall back on the Support of the service provider.
  • Cost: Cost is a major consideration while choosing any service. You can compare a number of service providers at cdncalc.com and find the best CDN. Or cdnfinder.com, where you can use filters to find a CDN from among 35 service providers.

Types of Servers

The architecture of the CDNs will vary, and different CDNs have varying numbers of nodes and Points of Presence. The CDNs use a network of carriers, ISPs and network operators for hosting their servers and delivering content to the audience. The servers and networks can be owned by the CDN or can be a mix of owned and leased.

CDNs can use different types of servers.

  • Pull server: This server is ideal for WordPress users and is great for delivering small files. Working with this kind of server requires that all your data is stored in your original server (meaning enhanced server space at your end). When a request is made near a CDN server, that server will pull the data from your original server and render it to the user. The first user does not really experience any of the benefits of reduced load time. But the page gets cached in the CDN, and subsequent users will witness the full benefits of CDNs. The file from the server is cached till it expires. The pull method is easier, cheaper and simpler.
  • Push Server: In this type of server, you upload your files to the service provider’s server. This is more suited to larger files and will be more expensive, as you may have to purchase server space in the CDN.
  • Peer to Peer Server: These servers rely on a huge number of computers connected across the internet. There is no central server. It is quite inexpensive to use these servers, but the security in this network is not much to speak of.

How to Integrate a CDN with WordPress

Integrating a CDN with WordPress is simplified a great deal by the use of plugins. Most service providers need you to activate plugins and choose the options that are specific to your website. Normally, you should not run into any problems, but if you do come up against a hitch, you may need some hand holding to complete the integration.

Just follow these ten simple steps:

1. Pick a CDN Provider: Open an account with a CDN service provider. Each CDN is a bit different in the way it integrates with WordPress. But some steps in the setup process are common to all.

2. Backup: As always, when attempting major changes to your website, first backup all your files and database (read more on backups).

3. Plugin download: You will likely be required to download, install and activate a plugin (such as W3 Total Cache (free), WP Super Cache (free) or WP Rocket (premium)), to assist you in the integration process.

4. Plugin Settings: After the plugin is activated, visit the settings page. This page is pretty much self-explanatory and you can adjust settings to your requirement.

5. W3 Total Cache: If the service provider does not provide or recommend a particular plugin, the plugin that’s probably most commonly independently recommended is W3 Total Cache. Download and activate this plugin from the WordPress Plugins Repository. Visit the Dashboard of your WordPress and click on Settings under Performance. Check the box to Enable CDN. Select the CDN provider with whom you have opened an account.

CDN

(click to enlarge)

6. CDN Settings: Now, find CDN under Performance and click on it. The settings in this page have different sections. In the General section, choose which folders are to be hosted on the CDN servers.

Total Cache General Settings

(click to enlarge)

7. Configuration: Scroll down to the Configuration section. You will be required to feed in the credentials given to you by the service provider (if you haven’t received these yet, contact their support to ask). Once you’ve done this, you can Replace Host Site Name with the host name provided by your CDN service provider.

CDN Configuration

(click to enlarge)

The ‘CDN URL’ that you need to fill in can be found in the Pull Zone that you create with your service provider. (more on Pull Zone in the next point). Simply copy from there and paste it in this field.

The URL paths will look different on a page accessed over a CDN network. This is because the access to these pages is now from a server in the CDN network, rather than your original server. These files normally take on the CDN’s URL automatically. Any page rendered to the user from your original server will have a URL as below:

http://www.mywebsite.com/wp-content/uploads/image01.png

When the file is uploaded to the CDN network server and served to the user from there, the URL will appear as below:

http://mywebsite.com.cdn.com/wp-content/uploads/image01.png

We can change this URL to

http://cdn.mywebite.com/wp-content/uploads/image01.png

Note that mywebsite.com.cdn.com is changed to cdn.mywebite.com. Your DNS settings must be changed to reflect this change. This may result in a few extra DNS queries, slowing down the response from the server. But we can make up for lost time as the response is fetched from the nearest CDN servers.

These changes are reversible and by undoing them, you can get the files to load from your original server again.

8. Pull Zone: In most cases, before you can obtain the CDN URL to fill into W3 Total Cache Settings, a pull zone is to be set up in the CDN server. Log in to your CDN account and from the control panel, create a pull zone and name it. Follow the instructions set out by the service provider. If you enter a custom domain, you will need to create a CNAME record for it.

Once you are done, you can test the setup and then save the settings in W3 Total Cache.

9. Upload using FTP: If the CDN you have picked does not support W3 Total Cache or any other plugin, you will have to opt for Self hosted or FTP supported CDN. To upload files using FTP, keep details like FTP host, user login credentials, security protocol and the FTP settings from the CDN service provider readily available.

10. Manual Upload: If FTP is not supported, you will have to manually upload the files. But this a complicated way to do things and not advised for a newbie. And with so many standard CDN providers around, I would not recommend a CDN which needs you to upload content manually.

A Quick Look at Some of the Most Popular CDN Providers

There are many quality CDN service providers catering to all kinds of websites, small or large. I have highlighted the features of a few of the more popular ones that are suited to small, medium and fairly large WordPress websites. I have not included those CDNs such as Akamai, which cater to huge, enterprise-level websites.

MaxCDN

MaxCDN counts many well-known names like WPEngine among the 16000 websites that use their services. Content is placed in 19 global PoPs. MaxCDN maintains Peering Agreements with Vodafone, AT&T, Verizon and Rogers for faster delivery of content to mobile phones.

MaxCDN

Integration with WordPress is by using W3 Total Cache. A mid-tier caching layer protects your origin server from request overload. Enhanced security is ensured with 2-factor authentication and IP whitelisting. Purging & provisioning, SSL activation and analytic reporting — all happen in real time. You can control the way content is delivered to users from the Edge Servers by changing the rules for the Edge Servers.

You can build a pay-per gigabyte custom package or opt for the standard packages at $9 or $299 per month. The two standard packages come with a 30-day money back guarantee.

CloudFlare

CloudFlare uses the most recent changes in hardware, web server technology and network routing to build a technologically advanced CDN that can load pages twice as fast and saves up to 60% in bandwidth. You can verify this claim from the analytic report for your website.

CloudFlare

CloudFlare combines with the CloudFlare WordPress Plugin to make CDN integration with WordPress easy. Not much configuration is required (most websites will work well with the default settings) and the CDN builds an Always Online version of your site. This version will serve up the important pages of your website, when your original server is down. CloudFlare safeguards your site from malicious attacks as well.

A basic free plan is offered for every website. There is no charge for bandwidth usage. Instead, a flat rate is collected based on the functions bundled in the plan. For a website that suddenly becomes popular, it means that it does not have to shell out extra for sudden bursts in traffic.

Note: for an extensive look at the differences between MaxCDN and CloudFlare, take a look at this in-depth earlier article of ours.

KeyCDN

KeyCDN is designed for speed and reliability. It offers the latest encryption features, two factor authentication and a pay-as-you-go feature. There is no fixed fee and you pay only for the data you transfer.

KeyCDN

It comes with a powerful dashboard that can manage the CDN and provide real-time analytics. The Anycast technology used by the network helps to route traffic optimally, to scale up speed and reduce latency.

On the features list, KeyCDN compares well with the more popular MaxCDN, while being a little cheaper. A 30-day free trial can be used to check out the features.

CDN77

CDN77 claims it has one of the most dense network of servers and can accelerate your website up to 56%. This service provider is so confident of its services that the homepage allows you to compare your present CDN with its own. CDN77 caters to the needs of about 8800 websites. The web-based control panel allows you to monitor things from wherever you are.

CDN77

Rich digital media in almost all formats can be transmitted without any disruption. High-quality gaming and capability to handle high traffic density will be a delight to gamers and gaming websites. CDN77 uses a special algorithm from Google for compression, improving usage of storage space and speed of loading. No DNS changes or any manual configuration is necessary, as everything is taken care of automatically. The folks here can also help you build your own Private CDN.

CDN77 offers a 14-day free trial, and after that you have to move to pay per byte plans. The plans vary for different regions and different data usage bands. For high bandwidth usage above 500TB, you can migrate to their High Volume Plans.

SoftLayer

SoftLayer, an IBM company, partners with Edgecast to establish 24 nodes in diverse geographical locations to offer fast and reliable CDN services. This is in addition to SoftLayer’s own network of data centers and Points of Presence.

SoftLayer CDN

Everything on this network is totally automated — server storage, firewalls, load balancing — all are controlled by management systems with their own APIs. These APIs are shared with the customers so they can tailor the CDN to suit their own specific needs.

SoftLayer is not simply a CDN — it is much more. If offers a whole basket of services including storage, backup, networking, security, management and support. It can completely service Big Data, Government, gaming, digital marketing, private clouds and reseller hosting services websites. It adopts a pay-as-you-go plan with a rate of $0.12/GB.

Photon

Photon from Jetpack isn’t a full-fledged CDN exactly. Instead, it caches WordPress images and serves it through the WordPress.com grid. Self-hosted websites can make use of this service via the Jetpack plugin The images you use in your posts and pages will automatically be sent to the WordPress.com cloud, when the plugin is activated.

Jetpack Photon

To start using this service, simply install Jetpack and activate the Photon module within the Jetpack page of your dashboard. You can apply it to older posts too and can turn the feature on and off at will. The flip side in Photon is that it caches GIF, PNG and JPG files only, but this should not really be seen as a drawback as most images anyway use these formats. The files are cached indefinitely. So, if you want to refresh an image, you will have to give it a new name. If the image takes longer than 10s to upload to Photon, it will be timed out.

jsDelivr

jsDelivr is a free and superfast CDN intended for webmasters and developers. It is supported by MaxCDN, KeyCDN, and CloudFlare. JavaScript code snippets are hosted in these JavaScript libraries for download by developers and others.

jsDeliver

jsDelivr uses a network of CDNs, so it can offer the best performance and fullest uptime. In places where the network coverage is inadequate, custom servers have been installed. jsDelivr has 98 PoPs spread over the globe. The smart load balancing software combines with multiple uptime monitoring checks, to detect any downtime and redirect traffic.

jsDelivr collaborates with multiple service providers for infrastructure. Because they are not dependent on any one vendor, they can negotiate the best possible deals for users. And if you want customized networks, they will build it for you.

Which CDN Should You Choose?

It’s worth pointing out that many small website with limited traffic may not actually need a CDN at all — and that many small to medium sites still using a basic shared hosting plan will in fact almost certainly make a far greater impact to the overall speed of their website by instead simply upgrading their hosting plan to a WordPress-Specific Managed WordPress Hosting Plan: many of which (such as WPEngine and Flywheel — to name two of the very best) will actually include use of a top-notch CDN for free anyway!

For appropriately-hosted sites that have already done the basics of web speed optimization (such as optimizing images, implementing a caching system, minimizing unnecessary server requests, etc) however, the addition of a CDN will almost certainly give you another much-welcome page-speed boost!

If your site is small and/or strapped for cash, take a look at some of the above-mentioned free services, such as Photon, CloudFlare and jsDeliver.

If you’re ready to try out more advanced CDN services (i.e. medium to large sites with the necessary funds), take a look at MaxCDN, KeyCDN and CloudFlare’s Premium Services.

And lastly, for those with both huge levels of global traffic and have the technical chops to match, take a look at RackSpace and Amazon’s CloudFront (which can both handle absolutely huge amounts of traffic).

Using a CDN? Which one and why?

Tweet about this on TwitterShare on FacebookGoogle+Share on LinkedInEmail to someone

By Vishnu Supreet

Freelance writer about all things WP | A mechanical engineer who creates awesome content for my clients to drive prospective leads to their business :)
Comments (policy)
More in Basics, Performance
A Quick Guide To Internal Links For SEO

Internal linking should be an important consideration for all website owners. Not only can readers and visitors click such links to discover further content on...

Close