PathBlockCache
extends GlobalBlockCache
in package
This strategy will cache blocks differently for each url path.
It has options to cache differently for each user, for guests/non guests or for each view port (mobile, tablet, desktop)
Table of Contents
- CACHE_TAG = 'themes.blockCache.path'
- $_options : BlockCacheStrategyOptions
- $mobileDetect : MobileDetect
- buildKey() : array<string|int, mixed>
- fields() : mixed
- getCache() : string|null
- get a block cache data.
- getDescription() : string
- Get strategy description
- getDuration() : int|null
- getHandle() : string
- getName() : string
- getOptions() : BlockStrategyOptions
- Get options model (populated)
- init() : mixed
- setCache() : mixed
- Set a block cache
- getOptionsModel() : BlockStrategyOptions
- Get options model
- getViewPort() : string
- Get user's view port
Constants
CACHE_TAG
public
mixed
CACHE_TAG
= 'themes.blockCache.path'
Properties
$_options
protected
BlockCacheStrategyOptions
$_options
$mobileDetect
protected
MobileDetect
$mobileDetect
Methods
buildKey()
public
buildKey(BlockInterface $block) : array<string|int, mixed>
Parameters
- $block : BlockInterface
Tags
Return values
array<string|int, mixed> —fields()
public
fields() : mixed
Tags
Return values
mixed —getCache()
get a block cache data.
public
getCache(BlockInterface $block) : string|null
Parameters
- $block : BlockInterface
Tags
Return values
string|null —getDescription()
Get strategy description
public
getDescription() : string
Tags
Return values
string —getDuration()
public
getDuration() : int|null
Tags
Return values
int|null —getHandle()
public
getHandle() : string
Tags
Return values
string —getName()
public
getName() : string
Tags
Return values
string —getOptions()
Get options model (populated)
public
getOptions() : BlockStrategyOptions
Tags
Return values
BlockStrategyOptions —init()
public
init() : mixed
Return values
mixed —setCache()
Set a block cache
public
setCache(BlockInterface $block, string $data, TagDependency $dep) : mixed
Parameters
- $block : BlockInterface
- $data : string
- $dep : TagDependency
Tags
Return values
mixed —getOptionsModel()
Get options model
protected
abstract getOptionsModel() : BlockStrategyOptions
Return values
BlockStrategyOptions —getViewPort()
Get user's view port
protected
getViewPort() : string