cachewerk / magento-relay
A Magento 2 module to integrate Relay.
Installs: 85
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 0
Open Issues: 0
Type:magento2-module
Requires
- php: ^7.3|^7.4|^8.0
- ext-relay: >=0.5.0
- cachewerk/relay: >=0.5.0
- magento/framework: >=100.0.0
README
Installation
First, install Relay as a PHP extension for your CLI and FPM environments.
Next, install the Magento module:
composer require cachewerk/magento-relay
Finally, activate the module. Relay won't be used until you configure Magento to do so.
bin/magento module:enable CacheWerk_Relay bin/magento setup:upgrade
Configuration
If you're not using Magento's Redis integration for caching and sessions, we recommend configuring and testing that first.
Sessions
To use Relay as the session backend, simply set session.redis.client
to relay
in your app/etc/env.php
:
'session' => [
'save' => 'redis',
'redis' => [
+ 'client' => 'relay',
'host' => '127.0.0.1',
'port' => 6379,
'database' => 2,
// ...
]
],
Cache Backends
Relay can be used for any Redis-enabled cache backend in your app/etc/env.php
:
'cache' => [ 'frontend' => [ 'default' => [ 'id_prefix' => '5ac_', - 'backend' => 'Magento\\Framework\\Cache\\Backend\\Redis', + 'backend' => 'CacheWerk\\Relay\\Cache\\Backend\\Relay', 'backend_options' => [ 'server' => '127.0.0.1', 'port' => 6379, 'database' => 0, // ... ] ], 'page_cache' => [ 'id_prefix' => '5ac_', - 'backend' => 'Magento\\Framework\\Cache\\Backend\\Redis', + 'backend' => 'CacheWerk\\Relay\\Cache\\Backend\\Relay', 'backend_options' => [ 'server' => '127.0.0.1', 'port' => 6379, 'database' => 1, // ... ] ] ], ],