[PaaS only]{class="badge informative" title="Applies to Adobe Commerce on Cloud projects (Adobe-managed PaaS infrastructure) and on-premises projects only."}

Cache backend options and storage reference

The Commerce application uses a low-level cache frontend and backend to provide access to cache storage. Commerce supports several caching backends and strategies, each suited to different use cases. This page describes the available backends and how they differ.

NOTE
For details about frontend cache configuration, see Configure cache frontends.

Backend cache options

The following table summarizes the available backend caches:

Backend
Description
Configuration guide
File system
Default. Stores cache data in files under var/cache/. No configuration required.
N/A
Redis
In-memory data store for high-performance caching.
Use Redis for default cache
Valkey
Open-source, Redis-compatible alternative.
Use Valkey for default cache
Database
Database-backed caching.
Create custom cache engines (Adobe developer documentation)
NOTE
Varnish handles full-page caching at the HTTP level and does not use the low-level cache backend.

Implementation approaches

Commerce supports two backend implementation approaches. The approach you choose depends on your Commerce version:

Legacy Zend-based cache (2.4.8 and earlier)

Uses full class names for the backend configuration:

table 0-row-2 1-row-2 2-row-2
Backend Class name
Redis Magento\Framework\Cache\Backend\Redis
Valkey Magento\Framework\Cache\Backend\Valkey

These are compatible with the Zend_Cache_Backend interface.

Example configuration:

code language-php?start_inline=1
'backend' => 'Magento\\Framework\\Cache\\Backend\\Redis',
'backend_options' => [
    'server' => '127.0.0.1',
    'database' => '0',
    'port' => '6379',
],
Modern Symfony cache (2.4.9 and later, recommended)
note tip
TIP
The modern Symfony Cache implementation provides better performance through PSR-6 compliance, Igbinary serialization, gzip compression, Lua scripts, and persistent connections.

Uses simplified backend type names:

table 0-row-2 1-row-2 2-row-2 3-row-2
Backend Type name
Redis redis
Valkey valkey
File system file

Example configuration:

code language-php?start_inline=1
'backend' => 'redis',
'backend_options' => [
    'server' => '127.0.0.1',
    'database' => '0',
    'port' => '6379',
    'serializer' => 'igbinary',
    'compression_lib' => 'gzip',
],

For complete configuration options, see:

See the Laminas documentation for legacy Zend-based options.

recommendation-more-help
386822bd-e32c-40a8-81c2-ed90ad1e198c