Skip to content

Commit 0060db5

Browse files
committed
AC-8477: API page_cache/block/esi handles param enhancement
* semantic test fix
1 parent aa9c656 commit 0060db5

File tree

2 files changed

+10
-21
lines changed

2 files changed

+10
-21
lines changed

app/code/Magento/PageCache/Controller/Block.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Magento\Framework\Validator\RegexFactory;
1414
use Magento\Framework\App\ObjectManager;
1515
use Magento\Framework\View\Layout\LayoutCacheKeyInterface;
16-
use Magento\PageCache\Model\Config;
1716
use Magento\Framework\App\Config\ScopeConfigInterface;
1817

1918
abstract class Block extends \Magento\Framework\App\Action\Action
@@ -60,6 +59,11 @@ abstract class Block extends \Magento\Framework\App\Action\Action
6059
*/
6160
private $config;
6261

62+
/**
63+
* Handle size system name
64+
*/
65+
public const XML_HANDLES_SIZE = 'system/full_page_cache/handles_size';
66+
6367
/**
6468
* @param \Magento\Framework\App\Action\Context $context
6569
* @param \Magento\Framework\Translate\InlineInterface $translateInline
@@ -107,7 +111,7 @@ protected function _getBlocks()
107111
$blocks = $this->jsonSerializer->unserialize($blocks);
108112
$handles = $this->base64jsonSerializer->unserialize($handles);
109113

110-
$handles_size = $this->config->getValue(Config::XML_HANDLES_SIZE);
114+
$handles_size = $this->config->getValue(self::XML_HANDLES_SIZE);
111115
$handles = (count($handles) > $handles_size) ? array_splice($handles, 0, $handles_size) : $handles;
112116

113117
if (!$this->validateHandleParam($handles)) {

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

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ class Config
3434
*/
3535
public const XML_PAGECACHE_TTL = 'system/full_page_cache/ttl';
3636

37-
public const XML_HANDLES_SIZE = 'system/full_page_cache/handles_size';
38-
3937
public const XML_PAGECACHE_TYPE = 'system/full_page_cache/caching_application';
4038

4139
public const XML_VARNISH_PAGECACHE_ACCESS_LIST = 'system/full_page_cache/varnish/access_list';
@@ -127,15 +125,6 @@ public function getType()
127125
return (int)$this->_scopeConfig->getValue(self::XML_PAGECACHE_TYPE);
128126
}
129127

130-
/**
131-
* Return hnadles param size
132-
*
133-
* @return int
134-
*/
135-
public function getHandlesSize()
136-
{
137-
return (int)$this->_scopeConfig->getValue(self::XML_HANDLES_SIZE);
138-
}
139128

140129
/**
141130
* Return page lifetime
@@ -152,8 +141,7 @@ public function getTtl()
152141
*
153142
* @param string $vclTemplatePath
154143
* @return string
155-
* @deprecated 100.2.0
156-
* @see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
144+
* @deprecated 100.2.0 see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
157145
*/
158146
public function getVclFile($vclTemplatePath)
159147
{
@@ -192,8 +180,7 @@ public function getVclFile($vclTemplatePath)
192180
* Prepare data for VCL config
193181
*
194182
* @return array
195-
* @deprecated 100.2.0
196-
* @see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
183+
* @deprecated 100.2.0 see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
197184
*/
198185
protected function _getReplacements()
199186
{
@@ -223,8 +210,7 @@ protected function _getReplacements()
223210
* }
224211
*
225212
* @return mixed|null|string
226-
* @deprecated 100.2.0
227-
* @see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
213+
* @deprecated 100.2.0 see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
228214
*/
229215
protected function _getAccessList()
230216
{
@@ -250,8 +236,7 @@ protected function _getAccessList()
250236
* we have to convert "/pattern/iU" into "(?Ui)pattern"
251237
*
252238
* @return string
253-
* @deprecated 100.2.0
254-
* @see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
239+
* @deprecated 100.2.0 see \Magento\PageCache\Model\VclGeneratorInterface::generateVcl
255240
*/
256241
protected function _getDesignExceptions()
257242
{

0 commit comments

Comments
 (0)