Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-page-cache
Model
Controller
Result
VarnishPlugin.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\PageCache\Model\Controller\Result
;
7
8
use
Magento\PageCache\Model\Config
;
9
use
Magento\Framework\App\PageCache\Version
;
10
use
Magento\Framework\App\State
as
AppState
;
11
use
Magento\Framework\Registry
;
12
use
Magento\Framework\App\Response\Http
as
ResponseHttp
;
13
use
Magento\Framework\Controller\ResultInterface
;
14
18
class
VarnishPlugin
19
{
23
private
$config;
24
28
private
$version;
29
33
private
$state;
34
38
private
$registry;
39
46
public
function
__construct
(
Config
$config,
Version
$version,
AppState
$state,
Registry
$registry)
47
{
48
$this->config =
$config
;
49
$this->version =
$version
;
50
$this->state = $state;
51
$this->registry =
$registry
;
52
}
53
64
public
function
afterRenderResult
(
ResultInterface
$subject,
ResultInterface
$result
,
ResponseHttp
$response
)
65
{
66
$usePlugin = $this->registry->registry(
'use_page_cache_plugin'
);
67
68
if
($this->config->getType() ==
Config::VARNISH
&& $this->config->isEnabled() && $usePlugin) {
69
$this->version->process();
70
71
if
($this->state->getMode() == AppState::MODE_DEVELOPER) {
72
$response
->setHeader(
'X-Magento-Debug'
, 1);
73
}
74
}
75
76
return
$result
;
77
}
78
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Framework\App\Response\Http
Definition:
FileFactory.php:7
$response
$response
Definition:
404.php:11
Magento\PageCache\Model\Config\VARNISH
const VARNISH
Definition:
Config.php:28
$version
$version
Definition:
pre_composer_update_2.3.php:161
Magento\PageCache\Model\Controller\Result
Definition:
BuiltinPlugin.php:6
$config
$config
Definition:
fraud_order.php:17
Magento\PageCache\Model\Controller\Result\VarnishPlugin
Definition:
VarnishPlugin.php:18
Magento\Framework\Controller\ResultInterface
Definition:
ResultInterface.php:19
Magento\PageCache\Model\Controller\Result\VarnishPlugin\__construct
__construct(Config $config, Version $version, AppState $state, Registry $registry)
Definition:
VarnishPlugin.php:46
$registry
$registry
Definition:
bundle_product_with_not_visible_children_rollback.php:16
Magento\PageCache\Model\Controller\Result\VarnishPlugin\afterRenderResult
afterRenderResult(ResultInterface $subject, ResultInterface $result, ResponseHttp $response)
Definition:
VarnishPlugin.php:64
Magento\PageCache\Model\Config
Definition:
Config.php:21
Magento\Framework\App\State
Definition:
CleanupFiles.php:7
Magento\Framework\Registry
Definition:
Registry.php:18
Magento\Framework\App\PageCache\Version
Definition:
Version.php:12