Skip to content

Commit

Permalink
Forward port #11581 to 3.x
Browse files Browse the repository at this point in the history
Use the md5-sum of group keys instead of the actual group names. This
helps mitigate key overflow issues in redis and memcached.

It does change the cache keys used, but those have never been promised
to be backwards compatible.
  • Loading branch information
markstory committed Jan 7, 2018
1 parent 8583c77 commit 3d46087
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cache/CacheEngine.php
Expand Up @@ -252,7 +252,7 @@ public function key($key)

$prefix = '';
if ($this->_groupPrefix) {
$prefix = vsprintf($this->_groupPrefix, $this->groups());
$prefix = md5(implode('_', $this->groups()));
}

$key = preg_replace('/[\s]+/', '_', strtolower(trim(str_replace([DIRECTORY_SEPARATOR, '/', '.'], '_', (string)$key))));
Expand Down

0 comments on commit 3d46087

Please sign in to comment.