Laravel 8 Sail Redis not assuming the default cache driver #37191
Unanswered
adellinocasas
asked this question in
General
Replies: 2 comments
-
Are you taking into consideration the prefix for the key? I believe Laravel prefixes all cache keys when using redis for cache. Check the cache config file at the bottom I think. Should be similar to "app_name_cache_bar" instead of "bar". |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes, all keys from the app are prefix with "laravel_database_".
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel 8 and the dev environment is Sail - including Redis. The .env file:
CACHE_DRIVER=redis .. REDIS_HOST=redis REDIS_PASSWORD=null REDIS_PORT=6379
Using the Redis facade functions, like
Redis::set( 'bar', 'The hole of the moon' );
using redis-cli is possible to find the value stored in cache
but using
Cache::put('bar2', 'baz', 100);
or even
Cache::store('redis')->put('bar3', 'Awesome', 100);
the values cannot be seen using the redis console.
Please note:
dd(env('CACHE_DRIVER'));
shows "redis" .
Beta Was this translation helpful? Give feedback.
All reactions