PrestaShop Performance Optimization

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

PrestaShop Performance Optimization

PrestaShop 8.x on standard configuration gives TTFB 1.5–4 seconds on catalog with 2000+ products. Reasons: Smarty template compilation without cache, ORM with excessive JOIN queries, built-in file-based cache. Optimization gives TTFB 200–500ms with correct stack.

PrestaShop Built-in Cache

Admin > Advanced Parameters > Performance — main optimization panel.

Smarty:

  • Template compilation: Never recompile template files (not on dev)
  • Cache: Yes
  • Multi-front optimizations: Yes
  • Clear cache: Never clear cache files

CCC (Combine, Compress, Cache):

  • Smart cache for stylesheets: Yes
  • Smart cache for JavaScript: Yes
  • Apache optimization: Yes (generates .htaccess rules)
  • Minify HTML: Yes

Media servers — specify CDN domain for static files if used.

Memcache/Redis as Cache Backend

By default PrestaShop caches to files. Switch to Memcache or Redis through Admin > Advanced Parameters > Performance > Caching:

  • Caching system: Memcache or Redis
  • Add server: 127.0.0.1:6379

For Redis additionally in config/config.inc.php (if version doesn't support Redis via UI):

define('_PS_CACHE_ENABLED_', '1');
define('_PS_CACHING_SYSTEM_', 'CacheRedis');

CacheRedis class in PrestaShop 8 works via Predis. If using phpredis extension — 15–20% faster.

PHP OPcache

opcache.enable=1
opcache.memory_consumption=256
opcache.max_accelerated_files=20000
opcache.validate_timestamps=0    ; production
opcache.revalidate_freq=0
opcache.interned_strings_buffer=32
opcache.fast_shutdown=1

PrestaShop has large codebase — max_accelerated_files=20000 is necessary, standard 10000 is not enough.

MySQL: Indexes and Slow Log

-- Common PrestaShop queries without optimal index
ALTER TABLE ps_product_lang
  ADD INDEX idx_id_lang (id_lang, id_product);

ALTER TABLE ps_category_product
  ADD INDEX idx_id_category_pos (id_category, position);

ALTER TABLE ps_search_word
  ADD INDEX idx_word (word(50));

Slow query log:

[mysqld]
slow_query_log = 1
slow_query_log_file = /var/log/mysql/prestashop-slow.log
long_query_time = 1
log_queries_not_using_indexes = 1

Typical culprit in slow log — getProducts() query sorted by sales without index on ps_product_sale.

Modules and Their Performance Impact

Each active PrestaShop module adds hooks to page lifecycle. Diagnostics:

// config/defines.inc.php (temporarily)
define('_PS_DEBUG_PROFILING_', true);

After enabling, Debugger bar appears at bottom of page in browser with execution time for each hook.

Problematic module categories:

  • SEO modules — often make 3–10 additional requests per page
  • Live chat modules — load external scripts synchronously
  • Review modules — COUNT queries without cache for each product in listing

Nginx Configuration

# Static files
location ~* \.(jpg|jpeg|png|webp|gif|ico|svg|woff2|css|js)$ {
    expires 1y;
    add_header Cache-Control "public, immutable";
    access_log off;
    try_files $uri =404;
}

# Gzip
gzip on;
gzip_types text/plain text/css application/json application/javascript image/svg+xml;
gzip_comp_level 5;
gzip_min_length 512;
gzip_vary on;

# Forbid direct access to PrestaShop classes
location ~* \.(log|tpl|twig|sass|yml|lock)$ {
    deny all;
}

WebP and Images

PrestaShop 1.7.7+ supports WebP via Admin > Design > Image settings. Enable WebP formats — image sizes reduced by 25–40%. On listing page with 24 products, saves 500–800 KB.

Additionally — regenerate thumbnails with new sizes:

php bin/console prestashop:generate:thumbnails --type=all

Work Timeline

Setup built-in cache, OPcache, PHP-FPM, Redis, nginx: 1–2 days. Module audit and disabling slow ones: 1 day. Enable WebP, regenerate thumbnails, MySQL indexes: 0.5–1 day.