Skip to content

Commit 49a0bbb

Browse files
committed
MAGETWO-66343: [Performance] Anomaly increase in redis traffic
1 parent 6d52aa6 commit 49a0bbb

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

app/code/Magento/Config/App/Config/Type/System.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,21 @@ class System implements ConfigTypeInterface
5959
private $serializer;
6060

6161
/**
62-
* Key name for flag which displays whether configuration is cached or not.
63-
*
64-
* Once configuration is cached additional flag pushed to cache storage
65-
* to be able check cache existence without data load.
62+
* The type of config.
6663
*
6764
* @var string
6865
*/
69-
private $cacheExistenceKey = self::CONFIG_TYPE . '_CACHE_EXISTS';
66+
private $configType;
7067

7168
/**
72-
* The type of config.
69+
* Key name for flag which displays whether configuration is cached or not.
70+
*
71+
* Once configuration is cached additional flag pushed to cache storage
72+
* to be able check cache existence without data load.
7373
*
7474
* @var string
7575
*/
76-
private $configType;
76+
private $cacheExistenceKey;
7777

7878
/**
7979
* @param \Magento\Framework\App\Config\ConfigSourceInterface $source
@@ -103,6 +103,7 @@ public function __construct(
103103
$this->fallback = $fallback;
104104
$this->serializer = $serializer;
105105
$this->configType = $configType;
106+
$this->cacheExistenceKey = $this->configType . '_CACHE_EXISTS';
106107
}
107108

108109
/**
@@ -209,8 +210,8 @@ private function cacheConfig($data)
209210
foreach ($data as $scope => $scopeData) {
210211
foreach ($scopeData as $key => $config) {
211212
$this->cache->save(
212-
$this->serializer->serialize($this->data->getData()),
213-
self::CONFIG_TYPE,
213+
$this->serializer->serialize($config),
214+
$this->configType . '_' . $scope . $key,
214215
[self::CACHE_TAG]
215216
);
216217
}
@@ -237,7 +238,7 @@ private function readFromCache($path)
237238
$result = null;
238239
$pathParts = $this->getPathParts($path);
239240
if (!empty($pathParts)) {
240-
$result = $this->cache->load(self::CONFIG_TYPE . '_' . $pathParts[0] . $pathParts[1]);
241+
$result = $this->cache->load($this->configType . '_' . $pathParts[0] . $pathParts[1]);
241242
if ($result !== false) {
242243
$readData = $this->data->getData();
243244
$readData[$pathParts[0]][$pathParts[1]] = $this->serializer->unserialize($result);

0 commit comments

Comments
 (0)