PrestaShop Documentation, PrestaShop Tutorials

PrestaShop cache Management

In PrestaShop, cache management is very important for:

  • Faster page loading
  • Better SEO
  • Lower server load
  • Improved Core Web Vitals

But wrong cache settings can also cause:

  • Changes not appearing
  • Broken CSS/JS
  • Old templates loading

PrestaShop Cache Types

Cache TypePurpose
Smarty CacheCache template output
CCC CacheCombine/Compress CSS & JS
Symfony CacheModern PS 8/9 backend cache
Browser CacheStore static files in the browser
OPCachePHP bytecode cache
CDN CacheCloudflare/server caching
Database CacheQuery/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:

  • Smarty cache
  • Symfony cache
  • Temporary compiled files

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:

  • Combine CSS
  • Compress CSS
  • Compress JS
  • Cache JS

Settings:

SettingRecommended
Smart cache CSSYes
Smart cache JSYes
Minify HTMLYes
Apache optimizationYes

When to Disable CCC

Disable temporarily if:

  • CSS broken
  • JS errors
  • Module conflicts
  • Debugging layout issues

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:

  • Faster PHP execution
  • Lower CPU usage

Recommended settings:

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

Cloudflare Cache

If using Cloudflare:

After modifying:

  • CSS
  • JS
  • Theme
  • Module templates

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:

  • Redis
  • Memcached

For:

  • Sessions
  • Object caching
  • Faster database access

Good for high-traffic stores.


Common Cache Problems

ProblemSolution
Changes not visibleClear cache
CSS not updatingDisable CCC + purge CDN
White screenEnable debug
Slow admin panelClear Symfony cache
Module hook not updatingRecompile templates

Recommended Production Settings

SettingValue
Force compileNo
Smarty cacheYes
CCC CSSYes
CCC JSYes
Debug modeOff
OPCacheOn

Performance Optimisation Tips

  • Use WebP images
  • Enable GZIP/Brotli
  • Use CDN
  • Reduce modules
  • Avoid heavy homepage sliders
  • Optimize database regularly

Official documentation:

PrestaShop Performance Documentation

PrestaShop Official Website

About zohaibk

We develop useful addons for #E-Commerce and #CRM software to provide extra features.#PrestaShop,#Magento,#SugarCRM,#Vtiger & #Android #apps
View all posts by zohaibk →