×

Enable CDN in Prestashop and Resolve related issues - How to do it ?


Enable CDN in Prestashop and Resolve related issues - How to do it ?
Are you trying to enable CDN in Prestashop?

We can help you.

PrestaShop is an open-source eCommerce platform that allows us to run our online store either via self-hosting or in the cloud.
At times we may find Prestashop slowing down, we can use CDN to speed it up
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to enable CDN in Prestashop.

How to enable CDN in PrestaShop ?

To Integrate CDN with PrestaShop, follow the steps given below.
Firstly, we must take a backup of files and database.

If we wish to integrate a CDN service on https:// pages also, then we must use the CDN domain with SSL enabled.
If our website embeds custom fonts, then we must enable CORS first.
Also, ensure that the CDN domain is ready to use.

Steps for Enabling CDN in PrestaShop:

1. First, log in to the PrestaShop admin panel.

2. Then go to Advanced Parameters and take Performance.

3. Now, we must configure CCC (Combine, Compress, and Cache).

Smart Cache for CSS: Yes
Smart Cache for JavaScript: Yes


4. After that click Save.

5. Finally, we must configure Media servers (use only with CCC) and click Save.

Setting a media server URL in PrestaShop will improve static content delivery, website performance, GTMetrix as images, CSS, and JS files will be serviced via a cookie-free domain.
View HTML source code of web pages to verify that we are using CDN, we should see the source attribute of our images, CSS, JavaScript, etc. beginning with the CDN domain.
If we do not see our CDN domain in the source code of our web pages, then the website may be using any cache plugin/mechanism.
We can clear the cache and check again. Next, we will see the common error that we may face while enabling CDN.

How to resolve Common error faced while enabling CDN in PrestaShop ?

While configuring the PrestaShop Media Server URL, many customers face an issue when having this setup while using SSL certificate for their stores.

Cause for the error

The reason for the issue is that usually the SSL is valid for their main domain www/.domain.com and does not cover the Media Server subdomain used for cookie-free URL.

How to fix this error ?

Following are the steps to fix the above error:
1. Purchase a wildcard SSL to cover the subdomains as well *.domain.com.
2. Activate Cloudflare CDN using their Universel SSL to convert subdomain.
3. Processing Static Content via Shared SSL and mod_userdir

Most hosting providers support the Apache mod_userdir which allows to access the account via the server hostname using a URL such as http://hostname/~username.
Additionally, most hosting providers have valid and trusted SSL certificate installed for the server hostname, usually advertised as Shared SSL.
This Shared SSL can process static content via a cookie-free domain and still keep it secure via the https.
Unfortunately, PrestaShop does not accept URLs including ‘~’ character for the media server settings. However, we can set this with just a quick trick.

The steps to follow are given below:

1. Before changing any settings on PrestaShop installation, ensure that the account is accessible via mod_userdir and a valid SSL is available on the hosting server.
2. Log in to the PrestaShop admin panel and navigate to the Performance section under the Advanced Parameters menu.
3. From there take Media Servers and input any dummy URL such as static.domain.com

[Need assistance in fixing Prestashop errors? We can help you. ]

Who We Are ?

Most prominent, efficient, and well-performing IT companies and software solutions.

Related Posts