Performance and monitoring

Tips to speed up PrestaShop and improve its performance

Reviewed on 5 min read performance PrestaShop

PrestaShop runs smoothly when freshly installed, but as the catalogue and the traffic grow it can become slow. With a few settings in the admin panel you gain a lot of speed and reduce resource usage.

Almost all the settings are in Advanced Parameters > Performance. After each change, browse the shop (home page, categories, product page, cart and checkout) to check that everything still works.

PHP version and OPcache

Use the highest PHP version your PrestaShop version supports:

PrestaShop Recommended PHP
1.7.8 7.4
8.x 8.1
9.0 8.4
9.1 or later 8.5

Change it from cPanel's PHP selector and, on the same screen, check that the opcache extension is enabled. If you have old modules, check that the shop works after the change; if something fails, go back to the previous version from the same selector.

Smarty: the template engine

Smarty generates the pages from the theme's templates. A development configuration left behind in production is a very common cause of slowness: it forces the templates to be recompiled on every visit.

In Advanced Parameters > Performance, Smarty block, set it like this:

  • Template compilation: Never recompile template files.
  • Cache: Yes.
  • Caching type: File System.
  • Clear cache: Never clear cache files.

Recommended Smarty configuration in PrestaShop performance settings

With this configuration, if you modify the theme or a module and do not see the change, click Clear cache (top right on the same page). If you are going to make many design changes in a row, temporarily set Force compilation and go back to Never recompile template files when you finish.

CCC: combine, compress and cache

In the CCC (Combine, Compress and Cache) block on the same page, PrestaShop combines and compresses the theme's CSS and JavaScript so that the page weighs less and makes fewer requests:

  • Smart cache for CSS: Yes.
  • Smart cache for JavaScript: Yes.
  • Apache optimization: No. Our servers use LiteSpeed, and compression and browser caching are already configured on the server.

PrestaShop CCC options with Smart cache enabled

In PrestaShop 1.6 you will also see Move JavaScript to the end: enable it too.

The theme and modules have to be compatible with these options. If something stops working after enabling them (a menu, a filter, the cart), disable them one at a time until you find the one causing problems.

Caching system

In the Caching block:

  • Use cache: Yes.
  • Caching system: CacheApc.

CacheApc caching system enabled in PrestaShop

For CacheApc to work, the apcu extension has to be enabled in the PHP selector. If the option is greyed out or PrestaShop shows an error when saving, enable it there and try again.

Page cache with LiteSpeed Cache

For the biggest jump in speed, install the LiteSpeed Cache module for PrestaShop: it stores the pages that have already been generated and serves them directly from the web server, without running PHP on every visit. We explain it step by step in speed up PrestaShop with LiteSpeed Cache.

Do not combine it with another page cache module: use only one.

CDN for images, CSS and JavaScript

Serving static files from a CDN or a media server lightens the shop's load. It is explained in media servers and CDN in PrestaShop.

Geolocation

Geolocation checks each visitor's country on every visit, which adds work to every page and can cause errors. If you do not need it to restrict countries or show prices by region, disable it in International > Localization > Geolocation (in PrestaShop 1.6, Preferences > Geolocation).

We have an article on one of the problems it causes: 503 Overloaded error in PrestaShop.

Statistics modules

Visits and Visitors and Visitors online are enabled by default. They record every visit in the database, which keeps growing, and the information they give is very basic.

If you use Google Analytics, Matomo or another external tool, disable both in Modules > Module Manager: search for each one by name and choose Disable from its menu.

If it is still slow

If after these settings a page still takes a long time, analyse it with PHP X-Ray: it will tell you which module, function or SQL query is taking up the time. It is often a single badly written module.

You may also find useful

Something wrong or out of date? Tell us and we will review it.