Skip to content

Don't set CACHE_PREFIX to empty string by default #6542

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 18, 2025

Conversation

Jamesking56
Copy link
Contributor

@Jamesking56 Jamesking56 commented Feb 18, 2025

Setting CACHE_PREFIX to an empty string by default overrides the default behaviour of using APP_NAME in the cache config file:

/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing the APC, database, memcached, Redis, and DynamoDB cache
| stores, there might be other applications using the same cache. For
| that reason, you may prefix every cache key to avoid collisions.
|
*/

'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),

This leads to unintended consequences if this has been blindly copied into the app's main .env file without setting a value.

Leaving this unset would ensure that at least the app name is being used for this value and that it is set by the framework.

Setting this to an empty string by default overrides the default behaviour of using APP_NAME in the cache config file, this leads to unintended consequences if this has been blindly copied into the app's main .env file without setting a value
@taylorotwell taylorotwell merged commit ecf6de4 into laravel:11.x Feb 18, 2025
6 checks passed
@Jamesking56 Jamesking56 deleted the patch-1 branch February 18, 2025 16:41
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