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 Infomaniak Web Hosting.
Preamble
- CDN stands for "Content Delivery Network" in English, which translates to "Content Distribution Network" in French.
- A CDN stores a copy of your site's content (images, videos, CSS/JS files) on multiple geographically dispersed servers.
- When a user accesses your site, the CDN provides this content from the server closest to their location, thus reducing loading times:
- Your site loads faster for visitors, which can reduce the bounce rate and improve the user experience.
- By distributing content, the CDN reduces the load on your main server, improving its performance and availability.
- Some CDNs offer security features such as protection against DDoS attacks and data security.
Setting up a CDN
To use a CDN, you will generally need to make adjustments to your domain name configuration, specifically to the DNS records. This will direct your website traffic to the CDN's network of servers. Therefore, 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 the CDN is working correctly.
Cloudflare-specific guide
For clients who want to optimize their site against the overload caused by the intensive passage of bots, using a CDN like Cloudflare is often recommended. The Cloudflare CDN allows you to optimize the performance and security of a website with features such as:
- 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 of the domain in question to Cloudflare (A records, MX, TXT, NS, etc.).
- On 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 simply acts as an intermediary between the site and Infomaniak, forwarding all requests to the Infomaniak 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.
Setting up "rate limiting" rules in Cloudflare's 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 are already using 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.