Archive for the ‘redis’ Category

Flush Redis cache

redis-cli flushall

PHP Laravel Redis caching examples

1. Directly with Redis class config/app.php … ‘providers’ => array( ‘Illuminate\Redis\RedisServiceProvider’, ), ‘aliases’ => array( ‘Redis’ => ‘Illuminate\Support\Facades\Redis’, ), config/database.php … ‘redis’ => array( ‘cluster’ => false, ‘default’ => array( ‘host’ => ‘127.0.0.1’, ‘port’ => 6379, ‘database’ => 0, ), ), … PHP code will look like this $redis = \Redis::connection(); if ($redis->exists($cacheKey)) { $results […]