Aller au contenu
Hébergement & cloud · Practical guide

CDN & performance

A CDN caches your files on geographically distributed servers to serve each visitor from the nearest point, speeding up sites and absorbing traffic peaks in Morocco.

Request a quote ↘

Some links on this page are affiliate links: we may earn a commission at no extra cost to you. Our approach

The CDN is one of the fastest performance gains to obtain: little configuration, an immediate effect on speed and useful protection against peaks and attacks. It does not replace that if the site is heavy on the inside. ## What a CDN really does It serves static files from a server close to the user, reduces the load on the origin server and absorbs abnormal traffic. It can also convert images and optimise network protocols. ## The limits A CDN does not make fast a site whose database is slow or whose pages are too heavy. Core Web Vitals depend mostly on images, scripts and first render: the performance audit must come before the CDN. ## The right start A free plan, a well-tuned cache and optimised images already deliver most of the gain. A professional CDN is justified when the site has an international audience, exposure to attacks or a need for advanced rules.

When this guide is for you

  • Your visitors come from several countries and experience uneven loading times
  • Your site slows down or goes down during campaigns and traffic peaks
  • You have suffered a DDoS attack or abnormal request spikes
  • Your images and videos are heavy and slow down page loading
  • You want to improve Core Web Vitals without rebuilding the site

Step by step

  1. Performance audit — Measure loading time, resource weight and Core Web Vitals scores (LCP, INP, CLS) before adding a CDN. Fix what belongs to the site itself first.
  2. Choose the CDN — Compare points of presence, cache rules, certificate management, compression options and security protection. Cloudflare's free plan is often enough to start.
  3. Configure caching — Define cache durations by resource type (images, CSS, JS) and exclude personalised or dynamic pages to avoid showing one user's content to another.
  4. Additional optimisations — Enable Brotli compression, conversion of images to modern formats (WebP, AVIF), lazy loading and HTTP/2 or HTTP/3.
  5. Monitoring and adjustments — Track cache hit rate, response times by geographic area and errors, then adjust the rules over time.

What it costs (in MAD)

ServiceIndicative priceGood to know
Free CDN (base plan)0 MADCloudflare Free: cache, SSL and basic protection
Professional CDN3,000 – 30,000 MAD / year (≈ 270 – 2,800 €)Advanced rules, WAF, optimised images and support
Configuration and optimisation3,000 – 15,000 MAD (≈ 270 – 1,400 €)Cache rules, image formats and tests
Performance audit5,000 – 20,000 MAD (≈ 450 – 1,800 €)Core Web Vitals, images, scripts and network
Advanced anti-DDoS protection5,000 – 60,000 MAD / year (≈ 450 – 5,500 €)Depends on how sensitive and exposed the site is

Indicative ranges for the Moroccan market in 2026, excluding tax. Prices vary with scope and provider.

Mistakes to avoid

  • Installing a CDN on an already heavy site without fixing images and scripts
  • Caching personalised pages and showing one customer's basket to another
  • Enabling aggressive protection without testing forms and payments
  • Leaving CSS and JS files cached too long after an update
  • Believing a CDN replaces image and code optimisation

Frequently asked questions

Is a CDN useful for a site targeting Morocco?

Yes, even for a local audience: visitors on 4G benefit from caching, compressed images and HTTP/2. The geographic effect is stronger for an international audience, but the performance and security gains are still real.

Is a free CDN enough?

For most SME sites, Cloudflare's free plan covers caching, SSL, compression and basic protection. Paid plans become useful for advanced rules, support and reinforced DDoS protection.

Does a CDN improve SEO?

Indirectly: speed and Core Web Vitals are signals Google takes into account. A faster site loads and reads better, which improves the experience and can improve ranking.

What should I do if the site shows outdated content after an update?

Purge the CDN cache and version file names (for example style.v2.css). If in doubt, temporarily exclude the relevant files from the cache while updating.

How long does it take to set up a CDN?

A few hours for a basic configuration and one or two days for fine-tuning cache rules and checking Core Web Vitals.

Updated on

Related guides

Version française: /services/hebergement-cloud/cdn/ · AR · NL