Skip to content

Commit f9b9ec1

Browse files
authored
ENGCOM-9207: 33465 Varnish cache adding top menu category ids to all page cache tags #33468
2 parents f87b678 + 3ad7252 commit f9b9ec1

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

app/code/Magento/PageCache/Model/App/CacheIdentifierPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct(
5555
*/
5656
public function afterGetValue(\Magento\Framework\App\PageCache\Identifier $identifier, $result)
5757
{
58-
if ($this->config->getType() == \Magento\PageCache\Model\Config::BUILT_IN && $this->config->isEnabled()) {
58+
if ($this->config->getType() === \Magento\PageCache\Model\Config::BUILT_IN && $this->config->isEnabled()) {
5959
$identifierPrefix = '';
6060

6161
$ruleDesignException = $this->designExceptions->getThemeByRequest($this->request);

app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function aroundDispatch(
6767
\Magento\Framework\App\RequestInterface $request
6868
) {
6969
$this->version->process();
70-
if (!$this->config->isEnabled() || $this->config->getType() != \Magento\PageCache\Model\Config::BUILT_IN) {
70+
if (!$this->config->isEnabled() || $this->config->getType() !== \Magento\PageCache\Model\Config::BUILT_IN) {
7171
return $proceed($request);
7272
}
7373
$result = $this->kernel->load();

app/code/Magento/PageCache/Model/App/FrontController/VarnishPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct(Config $config, Version $version, AppState $state)
5656
*/
5757
public function afterDispatch(FrontControllerInterface $subject, $result)
5858
{
59-
if ($this->config->getType() == Config::VARNISH && $this->config->isEnabled()
59+
if ($this->config->getType() === Config::VARNISH && $this->config->isEnabled()
6060
&& $result instanceof ResponseHttp
6161
) {
6262
$this->version->process();

app/code/Magento/PageCache/Model/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function __construct(
121121
*/
122122
public function getType()
123123
{
124-
return $this->_scopeConfig->getValue(self::XML_PAGECACHE_TYPE);
124+
return (int)$this->_scopeConfig->getValue(self::XML_PAGECACHE_TYPE);
125125
}
126126

127127
/**

app/code/Magento/PageCache/Model/Controller/Result/BuiltinPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function afterRenderResult(ResultInterface $subject, ResultInterface $res
6969
{
7070
$usePlugin = $this->registry->registry('use_page_cache_plugin');
7171

72-
if (!$usePlugin || !$this->config->isEnabled() || $this->config->getType() != Config::BUILT_IN) {
72+
if (!$usePlugin || !$this->config->isEnabled() || $this->config->getType() !== Config::BUILT_IN) {
7373
return $result;
7474
}
7575

app/code/Magento/PageCache/Model/Controller/Result/VarnishPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function afterRenderResult(ResultInterface $subject, ResultInterface $res
6565
{
6666
$usePlugin = $this->registry->registry('use_page_cache_plugin');
6767

68-
if ($this->config->getType() == Config::VARNISH && $this->config->isEnabled() && $usePlugin) {
68+
if ($this->config->getType() === Config::VARNISH && $this->config->isEnabled() && $usePlugin) {
6969
$this->version->process();
7070

7171
if ($this->state->getMode() == AppState::MODE_DEVELOPER) {

app/code/Magento/PageCache/Observer/FlushAllCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct(
6262
*/
6363
public function execute(Observer $observer)
6464
{
65-
if ($this->_config->getType() == Config::BUILT_IN) {
65+
if ($this->_config->getType() === Config::BUILT_IN) {
6666
$this->fullPageCache->clean();
6767
}
6868
}

app/code/Magento/PageCache/Observer/FlushCacheByTags.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function __construct(
7373
*/
7474
public function execute(Observer $observer)
7575
{
76-
if ($this->_config->getType() == Config::BUILT_IN && $this->_config->isEnabled()) {
76+
if ($this->_config->getType() === Config::BUILT_IN && $this->_config->isEnabled()) {
7777
$object = $observer->getEvent()->getObject();
7878
if (!is_object($object)) {
7979
return;

app/code/Magento/PageCache/Observer/ProcessLayoutRenderElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private function isFullPageCacheEnabled()
120120
private function isVarnishEnabled()
121121
{
122122
if ($this->isVarnishEnabled === null) {
123-
$this->isVarnishEnabled = ($this->_config->getType() == \Magento\PageCache\Model\Config::VARNISH);
123+
$this->isVarnishEnabled = ($this->_config->getType() === \Magento\PageCache\Model\Config::VARNISH);
124124
}
125125
return $this->isVarnishEnabled;
126126
}

app/code/Magento/PageCache/Test/Unit/Observer/ProcessLayoutRenderElementTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function testExecute(
151151
->method('isScopePrivate')
152152
->willReturn($scopeIsPrivate);
153153
}
154-
$this->_configMock->expects($this->any())->method('getType')->willReturn($varnishIsEnabled);
154+
$this->_configMock->expects($this->any())->method('getType')->willReturn(Config::VARNISH);
155155
}
156156
$this->_model->execute($this->_observerMock);
157157

@@ -210,7 +210,7 @@ public function testExecuteWithBase64Encode()
210210
->method('getNameInLayout')
211211
->willReturn('testBlockName');
212212

213-
$this->_configMock->expects($this->any())->method('getType')->willReturn(true);
213+
$this->_configMock->expects($this->any())->method('getType')->willReturn(Config::VARNISH);
214214

215215
$this->_model->execute($this->_observerMock);
216216

0 commit comments

Comments
 (0)