Which options to choose in the Prestashop Performance page to optimize the loading time of your store?

I explain here the role of each option and how to configure them to optimize Prestashop.

Smarty configuration

Smarty is the template engine used by Prestashop to generate the pages of your store, more info here: https://www.smarty.net/

Template compilation

Templates are files that describe the templates of pages or blocks of pages in your store. There are in your theme and in your modules, you recognize them by their extension '.tpl'. These templates contain HTML and Smarty tags, that is to say code that Smarty will recognize and replace by data depending on the page requested or the user connected.

Smarty will then transform (compile) these template files into PHP code so that your server can execute them but this compilation takes time. Fortunately this phase is only necessary once, as long as you do not modify the template file. 

There are 3 choices for this option:

  • Never recompile template files: select this option only if your store is completely finished and you do not modify any modules or template files. If this is the case you will have to empty the cache manually.
  • Recompile templates if the files have been updated: with this option Smarty will check if the template file has been modified since the last compilation. This is the option I recommend because a store is never really fixed and checking the last compilation date takes very little time. This avoids wasting time to understand why the last modification made to the store does not appear.
  • Force compilation: only activate this if you are working on your theme or a module, so only during development.

Cache

Smarty offers a cache system that modules can use to optimize their code. For example, the module displaying the best sales asks Smarty to cache the generated HTML, so when this cache is available the module does not need to consult the database to know the best sales, it displays the last content cached by Smarty. To stay up to date the module asks Smarty to empty the cache for each new sale as well as for each addition or deletion of a product.

This option must be activated except during the development phase of the store.

Multi-front optimizations

When using multiple servers, this option helps you synchronize their caches.

Caching type (removed since PS8)

Allows you to specify where the Smarty cache should be stored. I strongly recommend choosing "File system" so as not to overload the MySQL server.

Clear cache

Here is an option that leaves me perplexed because it allows you to disable the cache refreshment, it has no interest. If we take the example of the best sellers module, it means that the list would never be updated.

  • Never clear cache files: never choose this option
  • Clear cache everytime something has been modified: always choose this option

Debug mode configuration

Disable non PrestaShop modules

In case of error you can disable all modules except those developed by Prestashop. Leave it on "No".

Disable all overrides

You may have more problems by activating this option because without overloads some modules will not work anymore. The worst thing is that you won't get any error message to tell you that.

Debug mode

This is the most interesting option in case of blank page and 500 error. Activate the DEBUG mode and Prestashop will display a more detailed error message that will allow you to understand what is wrong.

Configuration of Optional features

Here it's very simple, if you don't use some features of Prestashop then you might as well disable them, your store will gain in speed.

CCC (Combine, Compress and Cache) 

Smart cache for CSS

To be activated absolutely except during the creation or modification phase of your website. This allows to merge all CSS files into one and to compress it. The loading time of your Prestashop store will be much faster and less heavy and you will get a better Pagespeed Insight score from Google or on GTMetrix.

If you notice style problems when your CSS is compressed, it is because one of the CSS files contains a syntax error. This one is well managed by the browser in a separate file and not compressed but not when CCC is activated. In this case you have to find the file in question and correct the error.

Smart cache for JavaScript

To be activated absolutely except during the creation or modification phase of your website. This allows you to merge all JavaScript files into one and compress it. You will get a better Pagespeed Insight score from Google or GTMetrix and the loading time of your web pages will be much faster and less heavy.

Good to know if your server uses HTTP/2 and HTTP/3 protocols.

HTTP/2 (H2) and HTTP/3 (H3) are newer versions of the HTTP protocol, designed to improve website performance and efficiency. They introduce features such as multiplexing, header compression, and server push. Multiplexing allows multiple requests to be sent simultaneously over a single TCP connection. This means that the overhead of additional requests is reduced, and the need to reduce the number of files for performance reasons is less critical.

On Prestashop, by not merging files (thus disabling CCC options), you avoid the need to download identical resources for pages that do not share the same merged JS or CSS files. Additionally, when using an HTML cache, this practice avoids the necessity of regenerating the entire cache each time a CSS or JS file is modified.

However, many modules do not minify their CSS and JS files, so you may incur a slight overhead in terms of download size (although gzip should reduce this overhead).

In conclusion, with HTTP/2 (H2) and HTTP/3 (H3) protocols, you can disable CCC options—it's your choice!

To find out if your server uses HTTP/2 (H2) and HTTP/3 (H3) protocols, open the browser console on your store, go to the Network tab, and see if the protocol used for static files (images, JavaScript, CSS, etc.) is h2 or h3.

Does my server uses protocols H2 and H3?

Apache optimization

It is essential to activate it except during the creation or modification phase of your website. This allows you to add the cache directives for the browsers, very important!

Media servers

Using a CDN (media server) is especially useful if your users come from all over the world. It allows to serve images, CSS, javascript and fonts faster because it is closer to the visitor. If you only sell in France for example, a CDN is not useful because your host is already close enough, unless you have priced an Australian host :-)

However you can use this option to use a different domain name to serve your static files. Why? So that the requests do not contain the cookies and are therefore less voluminous. For example you can create a domain name shopcdn.fr that points to the same server. This one is only used for static files and will not carry cookies.

Caching

This is a cache that is used for SQL queries executed by Prestashop. Personally, I don't recommend its use because it can degrade the performance of your store. Some users also complain about a refresh not always up to date.

Conclusion

You now know how to configure Prestashop to optimize the performance of your store. Each page will be generated faster by your server and will be lighter for a faster loading in the browser of your customers.

Feel free to browse our list of Prestashop modules to further optimize your store and improve your Google Pagespeed score!