Skip to content

[9.x] Remove extra underscore from cache key prefix #5938

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

Closed
wants to merge 1 commit into from
Closed

[9.x] Remove extra underscore from cache key prefix #5938

wants to merge 1 commit into from

Conversation

shatterproof
Copy link

@shatterproof shatterproof commented Jul 11, 2022

PR #5817 accidentally adds an excessive underscore to the end of the Redis cache key prefix, causing keys to become laravel_cache_:key instead of simply laravel_cache:key.

A colon is already included at the end of the prefix for Redis, which occurs in Illuminate\Cache\RedisStore.php:

public function setPrefix($prefix)
{
    $this->prefix = ! empty($prefix) ? $prefix.':' : '';
}

This commit will simply undo the change to streamline the prefix as it was before without the underscore.

The issue mentioned in the PR linked above only affects the database cache driver, so it would be more efficient and consistent to just add a colon to the prefix in Illuminate\Cache\DatabaseStore.php instead. (laravel/framework#43123)

@taylorotwell
Copy link
Member

I don't want to make a breaking change here.

@shatterproof shatterproof deleted the patch-1 branch July 11, 2022 20:36
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