What is CDN and how do I use it for my website?
It's common for people to use the acronym CDN, but its real name is Content Delivery Network or content distribution network.
If we decipher the name we quickly understand that the CDN is in fact a server network allowing content to be distributed, in this case, your website.
This server network is connected all over the world for two reasons:
Distribute content faster to the user: The closer you are to them, the faster the content will arrive. We're talking about a hundredth, a thousandth of a second, but it's HUGE when you know that a site should ideally load in 3 seconds MAXIMUM.
Secure the content of your website: Due to the fact that your site is accessible from all four corners of the world, it is "almost" impossible to find out which is the real server that hosts your website and therefore to attack it.
Which CDN solution to choose?
Several companies offer CDN offers such as OVH with an offer of 12$/ month or CloudFlare with offers of 0$ to 229 $ / month.
How do you configure Cloudflare on your site?
Attaching your site to CloudFlare's CDN isn't complex itself, but there are a few steps you need to follow.
Before you start, make sure you can change the DNS servers for your domain name.
2 - Secure your account with double authentication
This step is optional, but be aware that double authentication is currently the best way to protect your accounts (social networks, web hosting, etc.).
Once connected, click on your email address at the top right then "My profile".
Several are available to you, we advise you to opt for the Google Auth solution after installing the Google Authenticator application on your smartphone.
3 - Add a site on Cloudflare
After clicking on "Add site" at the top right, simply add your site address then click on "Scans DNS Records".
At this step, continue: Verify That All Of Your DNS Records Are Listed Below
You must now choose the offer that corresponds to you. We regularly opt for the Free offer which is sufficient in most cases.
Now, the most important step: Modify the DNS servers of your domain name at OVH, O2Switch, ... your registrar or host.
After this step, you must wait for the DNS servers to be replaced by those of CloudFlare (1 hour to 24 hours).
4 - Configure Cloudflare
Follow the steps below to help you set up your Cloudflare account:
- If your site is in HTTPS, activate Full or Full SSL (Strict), otherwise do not touch anything.
- If your site is in HTTPS, switch to On "Always use HTTPS", otherwise do not touch anything.
- If your site is in HTTPS, switch to On "Automatic HTTPS Rewrites", otherwise do not touch anything.
Choose the level of "Security Level" of your choice, we recommend "Medium"
Check the "Auto Minify" boxes only if you are sure of yourself and one by one to avoid seeing your site all distorted or inaccessible.
However, don't worry, if an option is not compatible with your site, you just have to uncheck it to return to normal.
Purge cache, use this option if you want to quickly see the changes after configuring Cloudflare or updating your website.
Caching level, go for standard mode.
Browser Cache Expiration, take your pick, we recommend 1 month.
Always Online ™ Error, switch to ON, if your host has a bug, your site will still be accessible.
Fashionable development, useful if you are making BIG changes to your site. This mode allows you to temporarily disconnect Cloudflare.
What is the cost of installing CDN?
Most CDNs are third-party paid services and it's likely to range from pricy, high-end setups for enterprise websites, to more affordable small/medium website oriented solutions.
The cost of a CDN is also determined by the bandwidth, region reach, and/or security/SSL needs. For instance, if you find that the majority of your users come from North America and Europe, you'll be able to omit purchasing server nodes in Asia.
CDNs don’t need to be cost-prohibitive and can be accessible to website owners of different amounts of budgets.