From 7ae84e3d5d1bd004a6c4e1cae3fa2be430f8b13a Mon Sep 17 00:00:00 2001 From: Val Bancer Date: Thu, 28 Dec 2017 10:02:35 +0100 Subject: [PATCH 1/2] Makes the cache key shorter by using md5() --- lib/Cake/Cache/CacheEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Cache/CacheEngine.php b/lib/Cake/Cache/CacheEngine.php index 07322bbae..bd236ae5f 100644 --- a/lib/Cake/Cache/CacheEngine.php +++ b/lib/Cake/Cache/CacheEngine.php @@ -181,7 +181,7 @@ abstract class CacheEngine { $prefix = ''; if (!empty($this->_groupPrefix)) { - $prefix = vsprintf($this->_groupPrefix, $this->groups()); + $prefix = md5(vsprintf($this->_groupPrefix, $this->groups())); } $key = preg_replace('/[\s]+/', '_', strtolower(trim(str_replace(array(DS, '/', '.'), '_', strval($key))))); From 0f51c75157ca87e3cd206fefb75a475261003f18 Mon Sep 17 00:00:00 2001 From: Val Bancer Date: Thu, 28 Dec 2017 16:15:14 +0100 Subject: [PATCH 2/2] replaced vsprintf to implode --- lib/Cake/Cache/CacheEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Cache/CacheEngine.php b/lib/Cake/Cache/CacheEngine.php index bd236ae5f..3e2c25632 100644 --- a/lib/Cake/Cache/CacheEngine.php +++ b/lib/Cake/Cache/CacheEngine.php @@ -181,7 +181,7 @@ abstract class CacheEngine { $prefix = ''; if (!empty($this->_groupPrefix)) { - $prefix = md5(vsprintf($this->_groupPrefix, $this->groups())); + $prefix = md5(implode('_', $this->groups())); } $key = preg_replace('/[\s]+/', '_', strtolower(trim(str_replace(array(DS, '/', '.'), '_', strval($key)))));