Redis

The usage of Redis is similar to that of a database, for example in plugin/foo/config/redis.php

return [
    'default' => [
        'host' => '127.0.0.1',
        'password' => null,
        'port' => 6379,
        'database' => 0,
    ],
    'cache' => [
        'host' => '127.0.0.1',
        'password' => null,
        'port' => 6379,
        'database' => 1,
    ],
];

When using it

use support\Redis;
Redis::connection('plugin.foo.default')->get('key');
Redis::connection('plugin.foo.cache')->get('key');

Similarly, if you want to reuse the Redis configuration of the main project

use support\Redis;
Redis::get('key');
// Assuming the main project has also configured a cache connection
Redis::connection('cache')->get('key');