How to set up a CDN with PrestaShop

PrestaInsights Team

Setting up a CDN (Content Delivery Network) with PrestaShop helps significantly reduce loading times by serving static content (like images, CSS, JS) from servers closest to your users.

Step-by-Step: How to Set Up a CDN in PrestaShop

Step 1: Choose a CDN Provider

Popular options include:

Step 2: Set Up Your CDN Account

After selecting a CDN provider:

  1. Create an account.
  2. Add your domain (e.g., yourstore.com) as a pull zone.
  3. Note the CDN URL (e.g., yourstore.b-cdn.net or cdn.yourstore.com).

Step 3: Configure Static File Rules in PrestaShop

For PrestaShop 1.7, 8, or 9:

  1. Log in to the back office.
  2. Navigate to Advanced Parameters → Performance.
  3. Scroll to Media servers (use only with CCC).
  4. Add your CDN domain, such as cdn.yourstore.com.

Note: You must enable Smart Cache for CSS and JavaScript for media server fields to work.

Step 4: Update DNS (if using a custom subdomain)

  1. Go to your DNS manager (e.g., Cloudflare, GoDaddy).
  2. Add a CNAME record:
    • Name: cdn
    • Target: your CDN hostname (e.g., yourstore.b-cdn.net)
  3. Wait for DNS propagation (5–30 minutes).

Step 5: Test CDN Delivery

To confirm the CDN is serving your static files:

  • Open your website and inspect it using browser developer tools.
  • Go to the Network tab and verify that image, JS, and CSS files are being served from your CDN URL.
  • You can also test performance with tools like:

Optional: Use a CDN Integration Module

If you prefer a module-based solution, consider:

  • BunnyCDN Integration (third-party module)
  • Cloudflare Official Module for PrestaShop
  • Or hosting-provider CDN setup tools

Bonus Tips

  • Clear PrestaShop cache after making CDN changes.
  • Ensure your CDN supports HTTPS (SSL).
  • Enable GZIP compression and browser caching from your CDN dashboard.

Final Result

Once configured, your PrestaShop store will serve static content faster, improve global page speed, and enhance user experience and SEO performance.

Written by

PrestaInsights Team

At PrestaInsights, we specialize in everything PrestaShop, from hosting and performance optimization to module development and in-depth tutorials. Our goal is to help merchants, developers, and agencies succeed with up-to-date guides, practical insights, and proven best practices. Whether you're just getting started or scaling a high-traffic store, we're here to guide you.

Leave a comment

Your email address will not be published. Required fields are marked *