- [Instructor] No matter what type of site or service,
or app you're running,
leveraging a CDN
will have a significant positive impact on your performance.
These services are built specifically
to improve the performance of your sites
and have added benefits,
including closer delivery distances to your visitors,
protection from spam and DDoS attacks
and advanced automated optimizations
you often can't do yourself.
A CDN is a content delivery network
connected to your hosting server.
Without a CDN,
every visitor has to get files from your server,
with a CDN,
the CDN grabs a copy of your site,
caches it and distributes it
to all of its distributed servers,
and the visitor gets a copy
from whatever CDN server is closest to them,
that way, the user gets much faster access to your site
and the load on your hosting provider is far less severe.
Many CDNs also automate some of the optimizations
we've covered in this course.
As an example, Cloudflare, a popular CDN
can be configured to automatically generate and save
WebP versions of all images on your site,
and then serve it to browsers supporting that image format.
This is done on the fly
and without you having to generate WebP yourself.
In fact, right in the documentation
it tells you not to generate WebP
to ensure that older browsers get images
in a format they understand.
The CDN just does a better job
at converting WebP than you can do.
CDNs provide significant performance benefits for you,
and also offload a lot of traffic from your web host.
So many web hosts now provide
simple one-click setups for CDNs,
or even automatically add your sites to a CDN.
In short, adding a CDN to your website or web app
is an essential part of your performance strategy,
and learning how to take full advantage
of all the features your chosen CDN has to offer,
including image optimization
and cash management and automated compression,
and all of that stuff,
will further improve the performance score of your site.