1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Optimize content delivery (CDN)
This guide explains how to activate a CDN to optimize an Web Hosting Infomaniak.
Preamble
- CDN stands for "Content Delivery Network" in English, which translates to "Content Delivery Network" in French.
- A CDN stores a copy of your site's content (images, videos, CSS/JS files) on multiple servers spread geographically.
- When a user accesses your site, the CDN delivers this content from the server closest to their location, thereby reducing load times:
- Your site loads faster for visitors, which can reduce the bounce rate and improve the user experience.
- By distributing the content, the CDN reduces the load on your main server, improving its performance and availability.
- Some CDNs offer security features like protection against DDoS attacks and data security.
Setting up a CDN
To use a CDN, you will generally need to make adjustments to the configuration of your domain name, specifically at the DNS record level. This will direct the traffic of your website to the CDN's network of servers. In general:
- Create an account on the website of your chosen CDN and add your site to it.
- Modify the DNS zone of your domain name according to the instructions provided by the CDN.
- Test your site to ensure that the CDN is working properly.
Cloudflare Specific Guide
For customers who want to optimize their site against overloads caused by the intense passage of bots, the use of a CDN like Cloudflare is often recommended. The Cloudflare CDN allows you to optimize the performance and security of a website with the following features:
- caching of a site's static content
- minification of HTML, CSS and Javascript code
- basic anti-DDoS protection
- etc.
To set up Cloudflare:
- If necessary, create an account with Cloudflare.
- Add the domain name of the site in question.
- Report **all** DNS zone records for the domain in question to Cloudflare (A, MX, TXT, NS records, etc.).
- In the Infomaniak Manager, modify the DNS of the domain in question with the DNS servers indicated by Cloudflare.
- Configure DKIM and DNSSEC if necessary.
- Any DNS addition/modification can take up to 48 hours to propagate.
Note: mod_cloudflare
is enabled by default on all paid web hostings.
Enable Cloudflare Rate Limiting
By default, Cloudflare acts as a mere intermediary between the site and Infomaniak, forwarding all requests to Infomaniak's servers. Thus, during traffic spikes or attacks, requests still reach the origin server, but with Cloudflare IP addresses, making it difficult to manage mitigation on a shared server.
Implementing "rate limiting" rules in Cloudflare's web application firewall is now an effective solution offered. This feature limits the number of requests sent to the server, blocking aggressive scans and protecting the server from excessive overloads.
And also…
… Amazon CloudFront
If you already use AWS services, CloudFront is easy to set up. Create a distribution, configure the settings and link it to your site.
… Fastly
Sign up on Fastly, configure your service by adding your site and setting the cache parameters. Fastly offers advanced configuration options.