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 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:
- 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:
| Setting | Recommended |
|---|---|
| Smart cache CSS | Yes |
| Smart cache JS | Yes |
| Minify HTML | Yes |
| Apache optimization | Yes |
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
| 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
- Use WebP images
- Enable GZIP/Brotli
- Use CDN
- Reduce modules
- Avoid heavy homepage sliders
- Optimize database regularly
Official documentation:
