Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cachewerk/magento-relay
A Magento 2 module to integrate Relay.
https://github.com/cachewerk/magento-relay
magento magento2 redis
Last synced: 4 days ago
JSON representation
A Magento 2 module to integrate Relay.
- Host: GitHub
- URL: https://github.com/cachewerk/magento-relay
- Owner: cachewerk
- License: mit
- Created: 2022-02-02T15:52:03.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-01T20:30:24.000Z (about 2 years ago)
- Last Synced: 2024-12-21T12:34:17.686Z (18 days ago)
- Topics: magento, magento2, redis
- Language: PHP
- Homepage: https://relay.so
- Size: 42 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Magento Relay
## Installation
First, [install Relay](https://relay.so/docs/installation) as a PHP extension for your CLI and FPM environments.
Next, install the Magento module:
```bash
composer require cachewerk/magento-relay
```Finally, activate the module. Relay won't be used until you configure Magento to do so.
```bash
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.
- [Use Redis for session storage](https://devdocs.magento.com/guides/v2.4/config-guide/redis/redis-session.html)
- [Use Redis for default cache](https://devdocs.magento.com/guides/v2.4/config-guide/redis/redis-pg-cache.html)### Sessions
To use Relay as the session backend, simply set `session.redis.client` to `relay` in your `app/etc/env.php`:
```diff
'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`:
```diff
'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,
// ...
]
]
],
],
```