Cache using a redis server. Redis is an open source, in-memory data structure store, used as a database, cache and message broker.
You must provide a Predis\Client
object to the constructor.
use Desarrolla2\Cache\Predis as PredisCache;
use Predis\Client as PredisClient;
$client = new PredisClient('tcp://localhost:6379');
$cache = new PredisCache($client);
Requires the predis
library.
composer require predis/predis
name | type | default | |
---|---|---|---|
ttl | int | null | Maximum time to live in seconds |
prefix | string | "" | Key prefix |
By default the SerializePacker
is used.