Skip to content

[9.x] Add underscore to prefix in database cache key #5817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 15, 2022

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