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 is the template engine used by Prestashop to generate the pages of your store, more info here: https://www.smarty.net/
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.
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.
When using multiple servers, this option helps you synchronize their caches.
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.
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.
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.
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 (use only with CCC)
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.
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.
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!