The Content Delivery Network aka CDN is the cluster network connected to each other to serve the static files from the closest data center to the end-user. The WordPress has it’s own CDN network known as Photon CDN that sync and serve the images from the WordPress blog.
However, officially WordPress Photon CDN needs a Jetpack Plugin to support free CDN. But, most WordPress bloggers and developers do not prefer installing Jetpack as it’s too heavy. Hence, a lot of WordPress users miss the chance to use this free CDN service.
In this article, we are going to learn how to set up the CDN Enabler plugin to use the WordPress Photon CDN address for serving the images via free CDN without installing the Jetpack module.
Let’s dive into setting up the free WordPress Photon CDN for media images without Jetpack plugin —
What is WordPress Photon CDN?
WordPress Photon CDN is the free image content delivery network that serves the locally uploaded images from the nearest data center server that is spread across the globe.
Say suppose my server is hosted at New York data center and a blog reader accessing the files from Sydney. This is quite a long distance for static files to travel, hence the website load time will increase significantly.
But, when we are using CDN service like WordPress Photon CDN for images. The static image files are synced across all WordPress data center. Now when the same reader access the files from Sydney, WordPress will try to access the static image from the nearest data center instead of our server location i.e. New York.
Hence, improving the site load speed and thus the user experience.
Install CDN Enabler WordPress Plugin
We are going to use this plugin called CDN Enabler by KeyCDN. This plugin helps to alter our website address and replace it with the WordPress photon’s address.
Follow the steps to install CDN Enabler on WordPress:
- Login to your WordPress Dashboard
- Navigate to Add New option under the Plugins menu
- Search and Install for CDN Enabler by KeyCDN
- Activate the plugin and head over to CDN Enabler settings page
Setup CDN Enabler plugin for Photon CDN
The Photon CDN has 4 different CDN address that helps to serve the images from WordPress CDN. The Photon CDN addresses are:
These addresses are dynamically changed when we use the Jetpack enabled Photon CDN. However, in our case, we will be using either one of the addresses since CDN Enabler has only one field.
Let’s use the first address i.e. i0.wp.com for our demo site. Setup the CDN Enabler with the below details and make sure that you’ve correctly entered your image library location.
- CDN URL: Enter the CDN address along with your domain name to serve the images. The CDN URL for my demo.restorebin.com will be: https://i0.wp.com/demo.restorebin.com
- Included Directories: These are the default image library directory in our WordPress installation. You can just leave it to default whatever this displayed in the field. You may also add multiple local directories by separating with ,
- Exclusions: List of file types that need to excluded from the CDN Enabler to apply the CDN URL. Make sure that you’ve excluded all the file types except image filetype. I personally exclude the following types: .php, .js, .json, .mp4, .pdf, .apk, .css
- Relative Path: Keep this option enabled
- CDN HTTPS: Enable this option to serve the images from HTTPS instead of HTTP. Since we have already set up the Let’s Encrypt SSL certificate, it’s important from a security standpoint that we are serving the images from HTTPS
- KeyCDN API Key and KeyCDN Zone ID shout be blank
Upload and Test Free Image CDN
Now let’s upload an image into our media library to see if the images are served from Photon CDN address. Since we have set up to use the i0.wp.com CDN address for all the images, our uploaded image should be served from the same address.
Video on Photon CDN without Jetpack
Watch the video tutorial on setting up the WordPress Photon CDN for serving the images from wp.com without using the Jetpack plugin.
I hope you liked the video, please subscribe to our channel.
What’s Next in #WordPressBlog Series?
Now that we have set up the free CDN for WordPress images using CDN Enabler, next we are going to touch base upon setting up the free CDN for our CSS styles and JS scripts files.
If you've any thoughts on Setup a Free Photon CDN without installing Jetpack Plugin for Images, then feel free to drop in below comment box. Cheers!