diff --git a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js index 5581bcb68842c..5d2c3b4ef0d79 100644 --- a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js +++ b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js @@ -196,10 +196,8 @@ define([ var countryData, privateContent = $.cookieStorage.get('private_content_version'); - if (_.isEmpty(storage.keys())) { - if (!_.isEmpty(privateContent)) { - this.reload([], false); - } + if (_.isEmpty(storage.keys()) && !_.isEmpty(privateContent)) { + this.reload([], false); } else if (this.needReload()) { _.each(dataProvider.getFromStorage(storage.keys()), function (sectionData, sectionName) { buffer.notify(sectionName, sectionData); diff --git a/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php b/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php index 37dcd1302b3a3..03f09f60556f3 100644 --- a/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php +++ b/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php @@ -64,10 +64,10 @@ public function aroundDispatch( \Closure $proceed, \Magento\Framework\App\RequestInterface $request ) { - $this->version->process(); if (!$this->config->isEnabled() || $this->config->getType() != \Magento\PageCache\Model\Config::BUILT_IN) { return $proceed($request); } + $this->version->process(); $result = $this->kernel->load(); if ($result === false) { $result = $proceed($request); diff --git a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php index 7baa4f62361d4..0ce0fd8811248 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php @@ -219,7 +219,7 @@ public function testAroundDispatchDisabled($state) ->method('isEnabled') ->will($this->returnValue(true)); $this->versionMock - ->expects($this->once()) + ->expects($this->never()) ->method('process'); $this->stateMock->expects($this->any()) ->method('getMode')