A content delivery network, or CDN, is a distributed network of data centers. The goal of a content delivery network is to enable data to load faster for users and ensure availability in case one server is down. Content delivery networks typically handle large files, including video streams, images, media files, and software downloads, but they can be used to handle any type of data.
Latency and website speed
Many factors can affect the speed at which your website loads. Obviously, someone with a broadband Internet connection will be able to load websites faster than someone visiting the same website with a dial-up connection. However, a user’s connection speed isn’t the only factor that determines how fast your website will load. The size of your content makes a huge difference — videos and large images will load more slowly than text-only content, for example. But even beyond the content on a website itself, other factors can slow a site down.
Latency is the term used to describe the delay that occurs between the time you request content — clicking a link, entering a URL, etc. — and the content appearing on your screen. The responsiveness of your website’s host can make a difference here, as a fast website host will send a quicker response than a slow one, regardless of the user’s connection speed.
That’s where a CDN comes in. The CDN makes copies of the data on the server of origin to other servers, called cache servers. The cache servers are refreshed at a preselected interval of time. By distributing copies of data around the globe, a user can receive data more quickly because it doesn’t have as far to travel. Instead of a user in the United States having to wait on data to load from Europe, a CDN can serve users in the United States data from North America. The same goes for any other area, of course, as long as the CDN has a server there.
Downfalls of using a content delivery network
Caching content on a content delivery network helps serve data to users faster, especially when users are located in a different country or continent than the server of origin. Unfortunately, though, it’s not practical in every application. If a server dynamically creates files rapidly, such as an image with a graph detailing live information, caching will not be a good option as the cached copy will not be updated until the cache server refreshes. In other words, if cache servers update their copy of data once an hour and someone visits your website 30 minutes after the last refresh, the data will be 30 minutes out of date. While you can increase the rate at which the cache servers refresh their data, if data must be live up to the second, caching isn’t a good option.
Using a content delivery network with WordPress
As a WordPress user, several options exist for enhancing content delivery. Jetpack offers a free CDN for images. To set it up, install the Jetpack plugin from WordPress.org or your WordPress dashboard, connect your site to WordPress.com, go to Jetpack → Settings → Writing in your WordPress Dashboard, and turn on the “Speed up images and photos” option.
Many caching plugins also offer compatibility with content delivery networks. Caching plugins also help speed up your site as they process server-side code and create static files that load faster. Like CDNs, they update at a set interval of time and are also not ideal for sites that update data frequently. However, if your data is not frequently updated, caching plugins used in tandem with a CDN can provide extremely fast load times for your users. WP Super Cache and W3 Total Cache both support integration with certain content delivery networks. To learn more about caching plugins and discover other tips to improve your site’s loading speed, see our 5 ways to make your site load faster.
Content delivery networks outside of WordPress
Many CDNs are not specifically designed to work with WordPress but can be used on any website. Cloudflare, Incapsula, and jsDelivr are all content delivery networks that require manual setup but can be used with any site, including WordPress-based websites.
Was this tip helpful? Subscribe to receive more!
Get our free WordPress tips delivered to your inbox once a week with MPWR Monday, our weekly email list. You’ll receive one email every Monday with a new WordPress tip.
You’ll also receive our Latest Post Redirect plugin for WordPress when you sign up! Latest Post Redirect allows you to use a shortcode to redirect a post or page to your latest blog post. Use it to keep an link to your latest work that automatically updates when you create new content.