Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dn-amsterdam/craft3-illuminate-redis-adapter
Redis Cache based on Illuminate redis for CraftCMS 3
https://github.com/dn-amsterdam/craft3-illuminate-redis-adapter
Last synced: 2 months ago
JSON representation
Redis Cache based on Illuminate redis for CraftCMS 3
- Host: GitHub
- URL: https://github.com/dn-amsterdam/craft3-illuminate-redis-adapter
- Owner: DN-Amsterdam
- License: mit
- Created: 2022-05-04T15:51:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-04T14:03:46.000Z (4 months ago)
- Last Synced: 2024-10-06T20:05:11.728Z (3 months ago)
- Language: PHP
- Size: 43 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# craft3-illuminate-redis-adapter
Redis Cache based on Illuminate redis for CraftCMS 3# Installation
You can install this package using composer;
```
composer require digitalnatives/craft3-illuminate-redis-adapter
```## Choose an adapter
### PHPredis (recommended)
For best performance we recommend using ext-phpredis#### Config
~~~php
return [
'components' => [
'cache' => [
'class' => DigitalNatives\Cache\Redis::class,
'defaultDuration' => 86400,
'connection' => 'phpredis',
'config' => [
'host' => getenv('REDIS_HOST'),
'port' => (int)getenv('REDIS_PORT'),
'database' => getenv('REDIS_DB'),
'connectTimeout' => 60,
'readTimeout' => 60,
'serializer' => \Redis::SERIALIZER_NONE
],
],
],
];
~~~### predis
When installing php extensions is not an option, predis is a very good option.If you haven't installed predis, install it using composer;
```
composer require predis/predis
```#### Config
~~~php
return [
'components' => [
'cache' => [
'class' => DigitalNatives\Cache\Redis::class,
'defaultDuration' => 86400,
'connection' => 'predis',
'params' => [
'host' => getenv('REDIS_HOST'),
'port' => (int)getenv('REDIS_PORT'),
],
'options' => [
['profile' => '5.0']
]
],
],
];
~~~