Skip to content

Conversation

m4tlch
Copy link
Contributor

@m4tlch m4tlch commented Feb 15, 2022

For Redis caching prefix with underscore :
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'database'),

but when cache stored in database, then the key is created "merged" with prefix, by this line: 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), for example, if "key" is a key for cache, then the result is: "laravel_cachekey", not a preferable "laravel_cache_key"

For Redis caching prefix with underscore : 
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),

but when cache stored in database, then the key is created "merged" with prefix, by this line:  'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), for example, if "key" is a key for cache, then the result is: "laravel_cachekey", not a preferable "laravel_cache_key"
@taylorotwell taylorotwell merged commit 19f4e34 into laravel:9.x Feb 15, 2022
@GrahamCampbell GrahamCampbell changed the title Add underscore to prefix in database cache key [9.x] Add underscore to prefix in database cache key Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants