In this article, we will learn how to install the WordPress plugin NGT jsDelivr CDN to enable Free CDN for CSS and JS files. And also, test on the live site for CDN URL changes.
Without further ado, let’s get started with setting up free CDN on the WordPress blog —
What is jsDelivr CDN?
jsDelivr is a free, fast, and reliable Open Source CDN for npm and GitHub with the most extensive network and best performance among all CDNs. jsDelivr serves more than 20 billion requests in a month.
It also supports WordPress CDN to load any plugin or theme from the SVN repository.
Cloudflare, StackPath, Fastly sponsor it, and a few other significant players in the internet world.
Installing the WP Plugin – NGT jsDelivr CDN
I found one brilliant WordPress plugin called NGT jsDelivr CDN by Nicolas Jonas. When writing this article, the plugin is not updated to the latest WordPress version. However, I use it, and it works flawlessly on my restoreBin blog.
All you need is to install and activate the plugin. It will take care of the rest. The plugin will automatically search and replace CSS and JS file links from the WordPress Core and Plugin SVN repo to serve via jsDelivr Free CDN.
If file URLs are unavailable in the SVN repo, the JS/CSS will be served from our web server. The Plugin does not have any cumbersome setup or setting pages to configure.
Follow the below steps to install NGT jsDelivr CDN for free:
- Login to your WordPress Dashboard
- Navigate to Add New under the Plugins menu
- Search and install the NGT jsDelivr CDN by Nicolas
- Activate the plugin
- That’s it
As I mentioned, there is no control panel for the plugin. Once activated, the plugin will take care of all the core and repo files.
Testing Free CDN for CSS and JS
Now that we have installed the plugin, let’s test it on the live site. Right-click and hit on the View page source command. Locate the plugins and WordPress core JS and CSS URLs to verify if they are being severed from the off-site URL — cdn.jsdelivr.net
[Note: if you’re using the FastCGI Nginx Cache, do not forget to clear the cache to make this CDN URL changes live.]
Before Plugin installation:
The files are served from our local cloud hosting server and domain name.
After Plugin installation:
The Core and Plugins files are served from the jdDelivr Free CDN.
That’s it. Your WordPress is enabled with Free CDN for CSS and JS script. This setup will help in saving tonnes of bandwidth if combined with the free image CDN for WordPress that I published earlier.
Video of Free CDN Setup in WordPress
A simple WordPress video demo of installing the NGT jsDelivr CDN plugin for Free CDN support and testing if the Free CDN is working and support the plugins and themes styles and scripts.
I hope you liked the video; please subscribe to our channel for more videos.
What’s next in the #WordPressBlog Series