Are you tired of slow loading pages and want to improve the loading speed of your pages? CDN is just the right solution for your problem. In this article we are going to share how you can use CDN with your WordPress website.
What is a CDN?
Content Delivery Network or CDN is a group of servers distributed globally to ensure fast delivery of content to a user. These can be static files such as images, scripts or stylesheets.
Why use a CDN?
A CDN is mainly used to improve the page loading speed. If a server is located far away from the user, a CDN will serve the content from the nearest server which will help in reducing the latency and time it takes to load the page.
CDN caches static content on it’s servers locally which helps in reducing the stress from your main server. A faster loading website also provides a good user experience and the website will have better search engine rankings.
How to use a CDN with your WordPress website
There are many CDN services that allow you to integrate CDN with your WordPress website. We are going to show how you can use the free Cloudflare CDN service to add CDN to your website.
- Visit the Cloudflare sign up page to register an account. Enter your email and password and click on the Create Account button.
- Enter your website’s url now and click on the Add site button.
- Choose the Free plan and click on the Confirm plan button.
- A list of DNS records will be shown, find your primary domain and make sure that an orange cloud icon is visible next to it. Click on the continue button now.
- You will now be shown two Cloudflare’s nameservers that you will have to copy and replace your current nameservers with them.
- To change the nameservers visit your domain registrar and click on the nameservers option of your domain name. Edit the current nameservers and replace them with the two nameservers provided by Cloudflare.
- Now go back to the cloudflare dashboard and click on the Done, check nameservers button.
- Once the nameservers are updated you will see a success message on your cloudflare dashboard.
Configuring Cloudflare from your WordPress admin dashboard
Install and activate the Cloudflare plugin to manage its settings from your WordPress website.
Visit Settings -> Cloudflare from your admin dashboard.
Click on the Sign in here button.
You will need an API Key to access your account from your admin dashboard.
Open your Cloudflare account on their official website and open the My Profile page. Under the API Tokens tab you will find an API Keys option.
Click on the View button next to Global API Key option. A popup will appear with the API key. Copy it.
Now in your WordPress admin dashboard enter the email address and the API Key we just copied and click on the Save API Credentials button.
You can now manage Cloudflare from the Settings -> Cloudflare dashboard.
Having a CDN for your website is necessary if your page loads slow. It can make a huge difference in the user experience and also benefit you tremendously with SEO.