Redis or Memcached for PrestaShop: which to pick and how to set it up
· The AYT team · 5 min read

PrestaShop supports Memcached (and APC/APCu) natively, under Advanced Parameters → Performance → Caching. Redis isn't supported directly: you need a third-party module. For most shops on a single server, Memcached is the simple choice, because you set it up in the back office with no extra code. A PrestaShop Redis cache makes sense if your server already has Redis and you find a maintained module for your version. Before either, check the Smarty cache, CCC and the PHP version: you usually gain more there.
What an object cache does in PrestaShop
An object cache keeps database query results in memory, so on the next request PrestaShop doesn't have to ask MySQL again. It doesn't store whole pages, so it won't make the shop instant, but it cuts the number of queries per page.
It helps most on:
- large catalogues, with many categories, features and combinations;
- shops with steady traffic, where the same data is requested hundreds of times a minute;
- servers where the database is the bottleneck.
It helps little on a small shop with a few hundred products and ordinary traffic: MySQL answers from its own memory there anyway.
What PrestaShop supports natively
Under Advanced Parameters → Performance, the Caching section has the "Use cache" and "Caching system" fields, with four options:
| Option | What it needs | Notes |
|---|---|---|
| Memcached via PHP::Memcached | the Memcached server and the memcached PHP extension |
the newer extension, also works with several servers |
| Memcached via PHP::Memcache | the Memcached server and the memcache PHP extension |
an older extension |
| APC | the apcu (or apc) PHP extension |
PHP's local memory, one server only |
| Xcache | the xcache extension |
abandoned, doesn't exist for PHP 7 and 8 |
Options are greyed out if the PHP extension is missing on the server. Redis isn't in the list.
Redis vs Memcached
| Criterion | Memcached | Redis |
|---|---|---|
| Support in PrestaShop | native, from the back office | only through third-party modules |
| Setup | a few fields under Performance | install and configure the module |
| What it stores | key-value pairs, in memory only | data structures, can also persist to disk |
| On server restart | the cache is emptied | can be kept |
| Risk at updates | low, it's part of the core | the module has to be updated along with PrestaShop |
For an object cache, the technical differences between Redis and Memcached matter little: both keep data in memory and answer in fractions of a millisecond. What matters is what your hosting offers and how well the module is maintained.
How to set up Memcached in PrestaShop
You need a running Memcached server (usually on 127.0.0.1, port 11211) and the memcached PHP extension. On shared hosting, either your host provides them or you don't have them.
- Back up the
app/config/parameters.phpfile. - In the back office, go to Advanced Parameters → Performance.
- Under Caching, set "Use cache" to Yes.
- Under "Caching system", choose "Memcached via PHP::Memcached".
- Add the server: IP address, port and weight, then save.
- Clear the cache and check the shop: the home page, a category, a product, the cart.
The setting is saved in app/config/parameters.php, in the ps_cache_enable and ps_caching keys. If the shop breaks after you turn it on (a 500 error), open the file, set 'ps_cache_enable' => false, then empty the var/cache folder. The steps for other causes are in the article on the PrestaShop 500 error.
How to use Redis with PrestaShop
Since the core has no Redis support, you need a module. You'll find a few on PrestaShop Addons and on GitHub. Before you install one:
- check the supported PrestaShop versions and the date of the last update;
- read how it behaves with multistore, if you use it;
- test it on a staging copy, not straight on the live shop;
- note how to turn it off through the files, in case the back office no longer starts.
An abandoned cache module is riskier than no cache: at the next PrestaShop upgrade it can take the whole shop down.
When an object cache isn't worth it
- The shop is small and pages already load in under a second.
- The slowness comes from elsewhere: debug mode on, forced template compilation or bloated statistics tables. See the slow PrestaShop back office.
- Your hosting has no Memcached or Redis. If you turn the cache on with no server behind it, the shop throws errors.
PrestaShop without Redis on AYT hosting
On AYT, Redis is not offered for PrestaShop: the account's Redis is used by other apps, such as WordPress and Laravel. The panel has no Memcached server to turn on either, so the Memcached options under Performance won't help you. For the speed of a PrestaShop 8 shop, the PrestaShop Toolkit has other tools:
- a 15-minute page cache in nginx, which never applies to the cart, checkout, logged-in customers or admin pages;
- under Settings, the Smarty settings (template compilation and cache) and CSS and JavaScript combining;
- the "Empty the caches" button and the Commands page for
cache:clear.

If you still want to try an object cache, the apcu extension can be turned on from the panel's PHP Extensions page, and PrestaShop uses it through the APC option. Test it on a staging copy first. The PHP version is chosen per site, and memory_limit is changed in the php.ini editor. See the toolkits on the features page and the plans on the hosting page.
