This article was contributed by Darshan.
We all love faster loading websites and so do the search engines, but is your website loading as fast as possible?
Should you invest in a Content Delivery Network (CDN) to improve the speed of your site?
What is a CDN?
Hosting your files on a content delivery network is one of the best ways to speed up your site, and can often save up to 60% bandwidth.
CDNs work by hosting your files across a large network of servers around the world. When a user visits your site from New Zealand, they are downloading files from the server that is closest to them. This reduces the load on any single server, making the site faster.
Let’s find out if you need a CDN or not, and how to get started with a CDN.
CDN Background Check
Before coming to any conclusion, we need to make some background checks. It will help us decide the precise route for your website speed optimization.
Nature of your website:
This is an important one as there are some domains like news, gadgets, lifestyle, travel, and food which are bound to have plenty of images on a single page or post.
Media upload frequency:
What is the frequency at which you upload media, images to be precise? The content publishing frequency does matter because the higher the frequency, the more the load your web server may need to bare serving those resources.
What is the traffic state of your website like? Do you have a media heavy website with thousands of visitors per day?
If you have positive answer to any or all of these points, you may need a CDN resource.
Before coming to that conclusion, or suppose you have negative answer to any of the points discussed above, you might not need a CDN just yet.
So, let’s start with image optimization first. The following section suggests some techniques that will help you optimize images for your WordPress website.
Imagery on the first look may not look like it’s slowing down your website. But if you ask any web expert, you will get to know that images are one of the primarily slowing down factor for any website.
I would not say that images are the only entity making your website slow and get rid of that. No. Instead I would recommend you have the images when it requires the most. It helps you improve website engagement.
What is image optimization?
Well, before diving deeper into the image optimization techniques, you must know what image optimization really is, and how it works.
We can divide images into roughly two main categories (Please don’t consider the vector and raster. We’ll be talking about the raster images only).
- Print media images
- Web media images
The images made to use for printing purpose have different characteristics like high resolution, larger height and width, and higher pixel density per inch. Because these images will be used in various media printing, holding and other print based physical marketing mediums.
On the other hand the web media images have different characteristics unlike its counterparts, these images are generally smaller in size, have small height and width, and lower pixel density.
How to optimize images?
As we are talking about the website, let’s see what are some ways you can optimize image for web.
a) Optimize using photo editing applications:
If you know how to work with Photoshop or similar, please use it.
You need to scale down the image width to 600px-900px and let height be proportional to the width. And reduce the pixel density to 72 pixels per inch.
Roit is one such free desktop application that you can use for optimization.
b) Optimize using a WordPress plugin:
If working with a desktop application is too much, you may consider a WordPress plugin.
There are some WordPress plugins available that makes your image optimization task quite automated.
The one similarity you may find with image optimization plugins, are they all optimize the images while you upload them to your server and an option to optimize all previously uploaded images.
EWWW image optimizer plugin might be the best one to start with.
Web Server and Traffic Geography
- If you have a large number of visitors coming to your website, and the traffic is distributed into different geographies, you should consider a CDN service.
- You are on a cloud based hosting environment, but your website is working and loading slow. This might be the best time to try a CDN service.
Why do we consider the traffic geography distribution?
Because all of your visitors from different locations, need to make a resource request to your central server. The longer the distance between your visitor and your web server, the longer it takes the images to reach.
How can a CDN help?
CDN service providers have a number of servers setup into various geographies. They cache your images and other static resources to all of their servers.
Now instead of requesting the central web server for resources, a visitor’s resource request gets mapped to the nearest geographical CDN server and the request served. It improves the turnaround time.
Pre CDN Test
If migrating to a cloud infrastructure works fine for you, and you’ve optimized your imagery, you probably don’t need a CDN service.
But if you find that you need CDN service integrated on your website, I would highly recommend you take a pre CDN performance test.
As you are on the WordPress framework, I highly recommend you use a cache mechanism. Some of the WordPress plugins make the caching thing extremely easy. And some also provide easy CDN service integration as well.
If you are not sure which caching plugin to use, WP Super Cache may be a good option to start with. The installation, configuration and usage is pretty easy. Additionally, you will find plenty of online resources working with this plugin.
CDN Providers & Selection
I would not suggest you to invest directly with a random CDN provider. There are many CDN providers, some are really cheap, while some are reliable.
Go through each of them and see which provider matches your requirements and price criteria. Many of the CDN providers, offer a free service trial for 14-30 days. It would be wise to first test the service and check the performance results, before investing.
There are plenty of CDN providers available to choose from, some of the front line players include: MaxCDN, KeyCDN, Amazon CloudFront, CloudFlare, and Microsoft Azure CDN. See here for web development and design services to help with the CDN selection or integration.
If you are not sure which CDN provider to choose, KeyCDN is the service I’ve personally tested before writing this article. No affiliation here, but I find their service reliable.
Additionally, they offer a free 14 day trial to test their service and performance of your website.
If you are looking for CDN integration guide, please follow the next point where I’ve discussed the CDN integration process.
If you are on the WordPress framework, a plugin will make setting up the CDN service, easy and quick.
No matter what CDN service you are opting for, there are common procedures you need to follow. Creating a “pull zone” is one of them. Login to your CDN provider’s website. Go to pull zone and hit the create button/link.
You will need to name the zone. Give it a meaningful name. Then you might be asked to select the zone type, so please select “PULL”, and finally you will be asked to provide the website URL, provide it.
All the major CDN providers have detailed documentation on the WordPress integration process. But if you want to follow a generic path, make sure you install the WP Super Cache plugin.
Plugin CDN Configuration:
Open the WP Super Cache plugin configuration page and check the Enable CDN Support checkbox.
Enter the KeyCDN zone URL into the Offsite URL text box and check the “Skip https URLs to avoid mixed content errors”. And hit the save changes button. That’s it!
Post CDN Test
Once you’ve integrated the CDN service, installed the required plugin and configured the website to use the CDN service, now you need to test your website with the same website speed test plugins we covered in point #5.
You should get the improved results if you have an image heavy website. Let the test run for a week or so to get a better idea.
Let the Googlebot crawl your website with CDN integration. If you have a slow crawl rate, you can use the ‘Fetch as Google’ tool and ask Google to crawl your home page and all the links into it.
Observe the traffic states and see whether you get any SEO benefits by having the improved ranking positions. Do you see the average session duration increasing and bounce ratio decreasing?
If you observe positive results, you may consider investing in the CDN service, once your free trial is over.
Having visual elements on your website may increase user engagement, but generally images make your website load and work slower. Having proper image optimization, caching, and the right CDN service, may help you address the situation.
Author Bio: Darshan is a WordPress enthusiast, he loves to share articles that help individuals get most out of their WordPress website. Feel free to contact for a WordPress based custom web application development.