Title: Using a CDN to enhance performance
Published: 6 August 2024
Last modified: 30 September 2024

---

[Home](https://learn.wordpress.org)[Courses](https://learn.wordpress.org/courses/)
[Advanced WordPress User](https://learn.wordpress.org/course/advanced-wordpress-user/)
Using a CDN to enhance performance

 [ Exit Course ](https://learn.wordpress.org/course/advanced-wordpress-user/)

 1.   a.  [   Unlocking advanced SEO techniques: Part 1  ](https://learn.wordpress.org/lesson/unlocking-advanced-seo-techniques-part-1-2/)
         [Preview](https://learn.wordpress.org/lesson/unlocking-advanced-seo-techniques-part-1-2/)
      b.  [   Unlocking advanced SEO techniques: Part 2  ](https://learn.wordpress.org/lesson/unlocking-advanced-seo-techniques-part-2-2/)
         [Preview](https://learn.wordpress.org/lesson/unlocking-advanced-seo-techniques-part-2-2/)
 2.   2 lessons
 3.   a.  [   Adding custom user roles using a WordPress plugin  ](https://learn.wordpress.org/lesson/adding-custom-user-roles-using-a-wordpress-plugin/)
         [Preview](https://learn.wordpress.org/lesson/adding-custom-user-roles-using-a-wordpress-plugin/)
 4.   1 lesson, 1 quiz
 5.   a.  [   Creating custom post types and taxonomies  ](https://learn.wordpress.org/lesson/creating-custom-post-types-and-taxonomies/)
         [Preview](https://learn.wordpress.org/lesson/creating-custom-post-types-and-taxonomies/)
      b.  [   WordPress taxonomies  ](https://learn.wordpress.org/lesson/wordpress-taxonomies-2/)
         [Preview](https://learn.wordpress.org/lesson/wordpress-taxonomies-2/)
 6.   2 lessons, 1 quiz
 7.   a.  [   Understand where your files live  ](https://learn.wordpress.org/lesson/understand-where-your-files-live/)
         [Preview](https://learn.wordpress.org/lesson/understand-where-your-files-live/)
      b.  [   Introduction to phpMyAdmin  ](https://learn.wordpress.org/lesson/introduction-to-phpmyadmin/)
         [Preview](https://learn.wordpress.org/lesson/introduction-to-phpmyadmin/)
 8.   2 lessons
 9.   a.  [   Using caching to improve website performance – W3 Total Cache plugin  ](https://learn.wordpress.org/lesson/using-caching-to-improve-website-performance-w3-total-cache-plugin/)
         [Preview](https://learn.wordpress.org/lesson/using-caching-to-improve-website-performance-w3-total-cache-plugin/)
      b.  [   Using a CDN to enhance performance  ](https://learn.wordpress.org/lesson/using-a-cdn-to-enhance-performance/)
         [Preview](https://learn.wordpress.org/lesson/using-a-cdn-to-enhance-performance/)
 10.  2 lessons, 2 quizzes
 11.  a.  [   Why would a WordPress user need to run a local site?  ](https://learn.wordpress.org/lesson/why-would-a-wordpress-user-need-to-run-a-local-site/)
         [Preview](https://learn.wordpress.org/lesson/why-would-a-wordpress-user-need-to-run-a-local-site/)
      b.  [   How to start using WordPress Playground  ](https://learn.wordpress.org/lesson/how-to-start-using-wordpress-playground/)
         [Preview](https://learn.wordpress.org/lesson/how-to-start-using-wordpress-playground/)
 12.  2 lessons, 1 quiz
 13.  a.  [   The building blocks of WordPress templates  ](https://learn.wordpress.org/lesson/the-building-blocks-of-wordpress-templates/)
         [Preview](https://learn.wordpress.org/lesson/the-building-blocks-of-wordpress-templates/)
      b.  [   How Styles are generated  ](https://learn.wordpress.org/lesson/how-styles-are-generated/)
         [Preview](https://learn.wordpress.org/lesson/how-styles-are-generated/)
 14.  2 lessons, 2 quizzes
 15.  a.  [   Troubleshooting your site: Plugin and theme conflicts  ](https://learn.wordpress.org/lesson/troubleshooting-your-site-plugin-and-theme-conflicts/)
         [Preview](https://learn.wordpress.org/lesson/troubleshooting-your-site-plugin-and-theme-conflicts/)
 16.  1 lesson
 17.  a.  [   Use WordPress to create a one-page site  ](https://learn.wordpress.org/lesson/use-wordpress-to-create-a-one-page-site/)
         [Preview](https://learn.wordpress.org/lesson/use-wordpress-to-create-a-one-page-site/)
      b.  [   Making the most of the Font Library  ](https://learn.wordpress.org/lesson/making-the-most-of-the-font-library/)
         [Preview](https://learn.wordpress.org/lesson/making-the-most-of-the-font-library/)
      c.  [   How to build a responsive WordPress website  ](https://learn.wordpress.org/lesson/how-to-build-a-responsive-wordpress-website/)
         [Preview](https://learn.wordpress.org/lesson/how-to-build-a-responsive-wordpress-website/)
      d.  [   Use the Create Block Theme plugin for exports, and theme variations  ](https://learn.wordpress.org/lesson/use-the-create-block-theme-plugin-for-exports-and-theme-variations/)
         [Preview](https://learn.wordpress.org/lesson/use-the-create-block-theme-plugin-for-exports-and-theme-variations/)
 18.  4 lessons, 3 quizzes
 19.  a.  [   What is WordPress Multisite?  ](https://learn.wordpress.org/lesson/what-is-wordpress-multisite/)
         [Preview](https://learn.wordpress.org/lesson/what-is-wordpress-multisite/)
      b.  [   Managing a WordPress Multisite network  ](https://learn.wordpress.org/lesson/managing-a-wordpress-multisite-network-2/)
         [Preview](https://learn.wordpress.org/lesson/managing-a-wordpress-multisite-network-2/)
 20.  2 lessons, 1 quiz

### Optimization

# Using a CDN to enhance performance

## Transcript

### Introduction

In this lesson, we will discuss enhancing your website’s performance with a Content
Delivery Network, or CDN. Before we explain how to set up a CDN, let’s define it.
A CDN is a global network of servers that caches your website’s static content, 
such as images, CSS, and JavaScript files. When a person visits your site, the CDN
delivers the content from the server closest to them, resulting in faster load times.
Using a CDN improves your website’s speed and reliability because it seamlessly 
stores your content on multiple servers, called Edge servers, rather than the single
origin server of your hosting provider. 

### Why use a CDN with WordPress?

Why use a CDN with WordPress? Using a CDN with WordPress offers several benefits
for desktop and mobile users alike. Number one, it improves global reach and reduces
delays. With servers located worldwide, your content loads faster for visitors, 
no matter where they are. Number two, it reduces server load. By offloading the 
delivery of static resources to the CDN, your web server can handle more traffic
and perform better. Thirdly, it increases uptime. CDNs ensure that if one Edge server
goes down, others will maintain your site’s availability. This is known as load 
balancing. And then fourthly, it enhances security, especially against DDoS attacks.
DDoS stands for distributed denial of servers. A type of cyber attack that overwhelms
your server with too much traffic, causing it to crash. A CDN helps prevent this
by spreading the traffic across multiple servers, making it harder for an attack
to succeed. 

### Configuring a CDN

Next, how do you set up a CDN with WordPress? Let’s walk through how to set up a
CDN with your WordPress site. Firstly, choose a CDN provider. Some vendors offer
free tiers, and most bundle other useful services such as SSL certificates and a
web application firewall. So research a CDN provider that’s right for your needs
and budget. Popular options include Cloudflare, KeyCDN, bunny.net, Sucuri, and Amazon
CloudFront. Please note that if you already used Jetpack, enable its free CDN feature,
Site Accelerator. 

Next, sign up and create an account. Some providers offer a WordPress plugin that
allows you to register for an account right from the WordPress dashboard. Navigate
to plugins, click on Add new plugin, type ‘CDN’ in the search field, and install
your chosen provider’s plugin. I will install and activate the Super Page Cache 
for Cloudflare plugin to create an account and add my website to Cloudflare. Back
in WordPress, the plugin will guide you through the setup process.

### CDN integration

The next step is optional, but if you already have a cache plugin installed, it’s
best to integrate it with the CDN to get the best results and avoid potential conflicts.
Let’s learn how to do it using several popular plugins. The first one is WP Optimize.
The cool thing is you don’t have to do anything as the plugin automatically integrates
with Cloudflare, ensuring caching works seamlessly with Cloudflare’s CDN services.
The second plugin is called W3 Total Cache. It has a built-in Cloudflare extension
that you need to activate under Extensions and then follow the setup instructions.
If you use a different CDN provider, navigate to General Settings, CDN, and then
enable CDN and select the one you wish to use and have signed up with. Next, you
can also use LiteSpeed Cache for WordPress. It integrates Cloudflare and QUIC.cloud
CDN. Make your way to settings, CDN, and here you can enable and set up either. 
The QUIC.cloud CDN option is at the top, and the Cloudflare option is available 
when you scroll to the bottom. You can also sign up and create a free QUIC.cloud
account under QUIC.cloud CDN setup. For detailed setup and configuration instructions,
please refer to the official manuals provided by the optimization plugin and CDN
provider you choose.

### Conclusion

In conclusion, a CDN can significantly improve load times, enhance user experience,
and boost your site’s overall resilience and security. It’s worth investing in this
extra layer of performance. To learn more optimization techniques, check out these
two complementary lessons, using caching to improve website performance and website
optimization.

 This is a preview lesson

Register or sign in to take this lesson.

 [ Take course ](https://learn.wordpress.org/course/advanced-wordpress-user/)

 [ Sign in ](https://login.wordpress.org/?redirect_to=https%3A%2F%2Flearn.wordpress.org%2Flesson%2Fusing-a-cdn-to-enhance-performance%2F&locale=en_US)

##  Suggestions

 Found a typo, grammar error or outdated screenshot? [Contact us](https://learn.wordpress.org/report-content-feedback/).