Should you use a CDN?
One of the biggest goals of website owners and developers is to serve their data quickly. When someone visits on a desktop computer or a pocket-sized smartphone, they should have equal ability to view and interact with that data fast. For WordPress, there are many options for optimizing page load speed. There are .htaccess file hacks, plugins, and image optimizers as well as script blockers. A lot of people consider a CDN when working to optimize their site for faster loading but they’re not sure if it’s something that would really help.
A CDN is actually a “content delivery network or content distribution network”. A performance increase is one of the biggest reasons to use a CDN. It has been proven time and time again that a faster loading site directly correlates with higher conversion rates, decreased bounce rates, and a longer average visitor duration. Normally, a site without a CDN serves all the visitor requests from a single server. The concern is that a request to load a web page from someone down the street from the server will render right away, but that same page will load much slower for someone thousands of miles in the distance.
With a CDN, the content of the web page is “mirrored” by various data centers that are widely scattered geographically. When a user makes a request for a website, it is served from the nearest data center. CDN services also support caching for even faster resource delivery. You may not end up with a server in each town but even with a little bit of latency, having data travel a few hundred miles is a pretty quick trip compared to a few thousand miles. Because it’s served from a mirrored and cached resource, using a CDN on dynamic content doesn’t work and is recommended for static content only.
Dynamic content includes frequently changing content that requires server logic like credit card transactions or updates to shopping carts on e-commerce sites, for example. Dynamic content is often categorized as “uncacheable” because it has to be passed through an origin server due to the sensitive nature of the data.
- – It’s safe to say that you probably don’t need a CDN if you’re offering a product or service to an audience that is mostly local. If traffic is easily handled by your hosting provider and your site has a relatively simple design, then a CDN would probably not be worth the cost.
- – If you’ve been experiencing website crashes or complaints about website performance… if you are targeting a worldwide audience but you don’t have a global hosting provider to provide speedy delivery and your traffic is too much for them to handle, then a CDN might be right for you.
Browsers can download a certain number of assets per web site concurrently. Since the CDN is on another site it’s not included in that limit. It can interfere with automated testing. If the CDN makes silent changes to the hosted file or turns out to be unreliable, tracking down the problem may be more difficult. Also, if for some reason the CDN performance is bad, it reflects badly on your website.
Most users who analyze their site through GTmetrix will have YSlow’s “Use a Content Delivery Network (CDN)” recommendation triggered. This leads many to believe that it’s a recommendation on the same level as some of the other recommendations like minify CSS or optimize images.
A CDN is not a self-contained fix like a server configuration change or a small code modification. CDNs are paid, third-party services, and so implementation of one depends on your goals, priorities and budget requirements.
So should you use a CDN? If you have a large website with a lot of resources and you have very high traffic, the answer would be yes. A CDN can help you improve load-time significantly.
You can, of course, use a CDN for resources with a small website that has a limited amount of resources, but the effect would not be very noticeable. One of the biggest advantages of a CDN is the ability to speed up content delivery to users all around the globe. But if you are targeting your content at users located within a given geographical region, the use of a CDN may not make sense.
If most of your audience is located in a country where the CDN has no servers, the data on your website may have to travel further than without using any CDN.
Do your research to find out where all the servers of the CDN provider are located. You don’t want to pay for servers that are located in places that will only reduce the performance of your website and increase latency and downtime for your customers. CDNs bring fewer benefits to smaller sites with relatively light traffic. Assuming you don’t require high-bandwidth video or audio files, it may be simpler to keep all your files in one place.