Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (\Magento\Framework\Filesystem\Directory\ReadFactory $readFactory, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\App\Cache\StateInterface $cacheState, \Magento\Framework\Module\Dir\Reader $reader, VclGeneratorFactory $vclGeneratorFactory, Json $serializer=null) | |
getType () | |
getTtl () | |
getVclFile ($vclTemplatePath) | |
isEnabled () | |
Data Fields | |
const | BUILT_IN = 1 |
const | VARNISH = 2 |
const | XML_PAGECACHE_TTL = 'system/full_page_cache/ttl' |
const | XML_PAGECACHE_TYPE = 'system/full_page_cache/caching_application' |
const | XML_VARNISH_PAGECACHE_ACCESS_LIST = 'system/full_page_cache/varnish/access_list' |
const | XML_VARNISH_PAGECACHE_BACKEND_PORT = 'system/full_page_cache/varnish/backend_port' |
const | XML_VARNISH_PAGECACHE_BACKEND_HOST = 'system/full_page_cache/varnish/backend_host' |
const | XML_VARNISH_PAGECACHE_GRACE_PERIOD = 'system/full_page_cache/varnish/grace_period' |
const | XML_VARNISH_PAGECACHE_DESIGN_THEME_REGEX = 'design/theme/ua_regexp' |
const | VARNISH_5_CONFIGURATION_PATH = 'system/full_page_cache/varnish5/path' |
const | VARNISH_4_CONFIGURATION_PATH = 'system/full_page_cache/varnish4/path' |
Protected Member Functions | |
_getReplacements () | |
_getAccessList () | |
_getDesignExceptions () | |
Protected Attributes | |
$_scopeConfig | |
$_cacheState | |
$readFactory | |
$reader | |
Model is responsible for replacing default vcl template file configuration with user-defined from configuration
@api
Definition at line 21 of file Config.php.
__construct | ( | \Magento\Framework\Filesystem\Directory\ReadFactory | $readFactory, |
\Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig, | ||
\Magento\Framework\App\Cache\StateInterface | $cacheState, | ||
\Magento\Framework\Module\Dir\Reader | $reader, | ||
VclGeneratorFactory | $vclGeneratorFactory, | ||
Json | $serializer = null |
||
) |
Filesystem\Directory\ReadFactory | $readFactory | |
\Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig | |
\Magento\Framework\App\Cache\StateInterface | $cacheState | |
Dir\Reader | $reader | |
VclGeneratorFactory | $vclGeneratorFactory | |
Json | null | $serializer |
Definition at line 95 of file Config.php.
|
protected |
Get IPs access list that can purge Varnish configuration for config file generation and transform it to appropriate view
acl purge{ "127.0.0.1"; "127.0.0.2";
Definition at line 200 of file Config.php.
|
protected |
Get regexs for design exceptions Different browser user-agents may use different themes Varnish supports regex with internal modifiers only so we have to convert "/pattern/iU" into "(?Ui)pattern"
Definition at line 225 of file Config.php.
|
protected |
Prepare data for VCL config
Definition at line 170 of file Config.php.
getTtl | ( | ) |
getType | ( | ) |
Return currently selected cache type: built in or varnish
Definition at line 117 of file Config.php.
getVclFile | ( | $vclTemplatePath | ) |
Return generated varnish.vcl configuration file
string | $vclTemplatePath |
Definition at line 141 of file Config.php.
isEnabled | ( | ) |
Whether a cache type is enabled in Cache Management Grid
Definition at line 257 of file Config.php.
|
protected |
Definition at line 65 of file Config.php.
|
protected |
Definition at line 50 of file Config.php.
|
protected |
Definition at line 75 of file Config.php.
|
protected |
Definition at line 70 of file Config.php.
const BUILT_IN = 1 |
Cache types
Definition at line 26 of file Config.php.
const VARNISH = 2 |
Definition at line 28 of file Config.php.
const VARNISH_4_CONFIGURATION_PATH = 'system/full_page_cache/varnish4/path' |
XML path to Varnish 4 config template path
Definition at line 60 of file Config.php.
const VARNISH_5_CONFIGURATION_PATH = 'system/full_page_cache/varnish5/path' |
XML path to Varnish 5 config template path
Definition at line 55 of file Config.php.
const XML_PAGECACHE_TTL = 'system/full_page_cache/ttl' |
XML path to Varnish settings
Definition at line 33 of file Config.php.
const XML_PAGECACHE_TYPE = 'system/full_page_cache/caching_application' |
Definition at line 35 of file Config.php.
const XML_VARNISH_PAGECACHE_ACCESS_LIST = 'system/full_page_cache/varnish/access_list' |
Definition at line 37 of file Config.php.
const XML_VARNISH_PAGECACHE_BACKEND_HOST = 'system/full_page_cache/varnish/backend_host' |
Definition at line 41 of file Config.php.
const XML_VARNISH_PAGECACHE_BACKEND_PORT = 'system/full_page_cache/varnish/backend_port' |
Definition at line 39 of file Config.php.
const XML_VARNISH_PAGECACHE_DESIGN_THEME_REGEX = 'design/theme/ua_regexp' |
Definition at line 45 of file Config.php.
const XML_VARNISH_PAGECACHE_GRACE_PERIOD = 'system/full_page_cache/varnish/grace_period' |
Definition at line 43 of file Config.php.