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
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 |
|---|
|
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 |
|---|
|
For complete configuration options, see:
See the Laminas documentation for legacy Zend-based options.
recommendation-more-help
386822bd-e32c-40a8-81c2-ed90ad1e198c