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
App
FrontController
VarnishPlugin.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\PageCache\Model\App\FrontController
;
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\App\FrontControllerInterface
;
12
use
Magento\Framework\App\ResponseInterface
;
13
use
Magento\Framework\App\Response\Http
as
ResponseHttp
;
14
use
Magento\Framework\Controller\ResultInterface
;
15
19
class
VarnishPlugin
20
{
24
private
$config;
25
29
private
$version;
30
34
private
$state;
35
41
public
function
__construct
(
Config
$config,
Version
$version,
AppState
$state)
42
{
43
$this->config =
$config
;
44
$this->version =
$version
;
45
$this->state = $state;
46
}
47
57
public
function
afterDispatch
(
FrontControllerInterface
$subject,
$result
)
58
{
59
if
($this->config->getType() ==
Config::VARNISH
&& $this->config->isEnabled()
60
&&
$result
instanceof
ResponseHttp
61
) {
62
$this->version->process();
63
64
if
($this->state->getMode() == AppState::MODE_DEVELOPER) {
65
$result
->setHeader(
'X-Magento-Debug'
, 1);
66
}
67
}
68
69
return
$result
;
70
}
71
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Framework\App\Response\Http
Definition:
FileFactory.php:7
Magento\PageCache\Model\Config\VARNISH
const VARNISH
Definition:
Config.php:28
$version
$version
Definition:
pre_composer_update_2.3.php:161
$config
$config
Definition:
fraud_order.php:17
Magento\Framework\Controller\ResultInterface
Definition:
ResultInterface.php:19
Magento\Framework\App\FrontControllerInterface
Definition:
FrontControllerInterface.php:16
Magento\PageCache\Model\Config
Definition:
Config.php:21
Magento\PageCache\Model\App\FrontController\VarnishPlugin\afterDispatch
afterDispatch(FrontControllerInterface $subject, $result)
Definition:
VarnishPlugin.php:57
Magento\Framework\App\State
Definition:
CleanupFiles.php:7
Magento\PageCache\Model\App\FrontController\VarnishPlugin
Definition:
VarnishPlugin.php:19
Magento\PageCache\Model\App\FrontController\VarnishPlugin\__construct
__construct(Config $config, Version $version, AppState $state)
Definition:
VarnishPlugin.php:41
Magento\PageCache\Model\App\FrontController
Definition:
BuiltinPlugin.php:6
Magento\Framework\App\ResponseInterface
Definition:
ResponseInterface.php:14
Magento\Framework\App\PageCache\Version
Definition:
Version.php:12