Site icon PrestaShop | Magento | CRM Modules

PrestaShop cache Management

In PrestaShop, cache management is very important for:

But wrong cache settings can also cause:

PrestaShop Cache Types

Cache Type Purpose
Smarty Cache Cache template output
CCC Cache Combine/Compress CSS & JS
Symfony Cache Modern PS 8/9 backend cache
Browser Cache Store static files in the browser
OPCache PHP bytecode cache
CDN Cache Cloudflare/server caching
Database Cache Query/object caching

Main Cache Settings

Go to:

Advanced Parameters → Performance


Smarty Settings

Template Compilation

Development Mode

Force compilation = Yes
Cache = No

Used while developing modules/themes.


Production Mode

Force compilation = No
Cache = Yes

Best for live stores.


Clear Cache

Inside Performance page:

Clear cache button

This removes:


Manual Cache Clear

PrestaShop 1.7 / 8 / 9

Delete contents inside:

/var/cache/prod/
/var/cache/dev/

Do NOT delete folders themselves.

Linux command:

rm -rf var/cache/prod/*
rm -rf var/cache/dev/*

Smarty Cache Folders

Older versions may use:

/cache/smarty/cache/
/cache/smarty/compile/

CCC (Combine Compress Cache)

CCC means:

Settings:

Setting Recommended
Smart cache CSS Yes
Smart cache JS Yes
Minify HTML Yes
Apache optimization Yes

When to Disable CCC

Disable temporarily if:


Symfony Cache (PS 8/9)

Modern PrestaShop uses Symfony framework.

Warm cache command:

php bin/console cache:warmup --env=prod

Clear cache:

php bin/console cache:clear

Enable Debug Mode

File:

/config/defines.inc.php

Change:

define('_PS_MODE_DEV_', true);

Or in newer versions:

APP_DEBUG=1

PHP OPCache

Recommended for production servers.

Benefits:

Recommended settings:

opcache.enable=1
opcache.memory_consumption=256
opcache.max_accelerated_files=20000

Cloudflare Cache

If using Cloudflare:

After modifying:

Use:

Caching → Purge Cache

Browser Cache

Add in .htaccess:

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/webp "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
</IfModule>

Redis / Memcached

Advanced stores use:

For:

Good for high-traffic stores.


Common Cache Problems

Problem Solution
Changes not visible Clear cache
CSS not updating Disable CCC + purge CDN
White screen Enable debug
Slow admin panel Clear Symfony cache
Module hook not updating Recompile templates

Recommended Production Settings

Setting Value
Force compile No
Smarty cache Yes
CCC CSS Yes
CCC JS Yes
Debug mode Off
OPCache On

Performance Optimisation Tips


Official documentation:

PrestaShop Performance Documentation

PrestaShop Official Website

Exit mobile version