I am trying to cache my results using redis
in Laravel
by doing this
$result = Cache::remember('orders_cache', 10, function () use ($orders) {
return $orders;
});
return $result;
When I go in my Redis-Cli and do KEYS *
, I don't see orders_cache
key there. I have set the cache_driver
to redis
in my .env
and I also ran the command php artisan config:cache
. I have also installed predis package using composer as well.
My Dev environment is:
- PHP7.4
- Ubuntu 20
- Laravel 6.0
- Redis 5.0.7
Any help on this would be appreciated. TIA
redis-cli -n 1 keys "*"
! – Malchy(empty list or set)
– Jeepers(empty list or set)
its because there is not anything in your databases, this commandredis-cli -n 1 keys "*"
says that show all keys in database with index of 1. that is your case this database is empty – Opportunism