1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Optimize content delivery (CDN)
This guide explains how to enable a CDN to optimize an Infomaniak Web Hosting.
Introduction
- CDN stands for "Content Delivery Network" in English, which translates to "Réseau de diffusion de contenu" in French.
- A CDN stores a copy of your site's content (images, videos, CSS/JS files) on multiple servers distributed geographically.
- When a user accesses your site, the CDN delivers this content from the server closest to their location, reducing loading times:
- Your site loads faster for visitors, potentially reducing bounce rates and improving 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 DDoS attack protection and data security.
Setting up a CDN
To use a CDN, you typically need to adjust your domain name's configuration, specifically the DNS records. This will direct your website traffic to the CDN's network of servers. Generally speaking:
- Create an account with the CDN provider of your choice and add your site.
- Modify your domain's DNS zone as per the instructions provided by the CDN.
- Test your site to ensure the CDN is functioning correctly.
Specific Guide for Cloudflare
For customers who want to optimize their site against overloads caused by heavy bot traffic, using a CDN like Cloudflare is often recommended. The Cloudflare CDN optimizes website performance and security with features such as:
- Caching static site content
- Minifying HTML, CSS, and JavaScript code
- Basic DDoS protection
- and more
To set up Cloudflare:
- If needed, create an account with Cloudflare.
- Add the domain name of the site you wish to optimize.
- Transfer all DNS zone records of the relevant domain to Cloudflare (A, MX, TXT, NS records, etc.).
- In the Infomaniak Manager, update the DNS of the relevant domain with the DNS servers provided by Cloudflare:
- Set up DKIM and DNSSEC if needed.
- Any DNS additions/changes may take up to 48 hours to propagate.
Note: The mod_cloudflare
module is enabled by default on all paid web hosting plans.
Enable Cloudflare Rate Limiting
By default, Cloudflare simply acts as an intermediary between the site and Infomaniak, forwarding all requests to Infomaniak servers. Thus, during traffic spikes or attacks, requests still reach the origin server but with Cloudflare IP addresses, making mitigation difficult on shared hosting.
Implementing "rate limiting" rules in Cloudflare’s application firewall is now an effective solution. This feature limits the number of requests sent to the server, blocking aggressive scans and protecting the server from excessive overload.
Additional Options
… 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 set the caching parameters. Fastly offers advanced configuration options.