Craft Themes (4.x)

QueryBlockCache extends GlobalBlockCache
in package

This strategy will cache blocks differently for each url path, query string included.

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.query'
$_options  : BlockCacheStrategyOptions
$mobileDetect  : MobileDetect
buildKey()  : array<string|int, mixed>
fields()  : array<string|int, 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()  : void
setCache()  : mixed
Set a block cache
getOptionsModel()  : BlockStrategyOptions
Get options model
getViewPort()  : string
Get user's view port

Constants

Properties

Methods

fields()

public fields() : array<string|int, mixed>
Tags
inheritDoc
Return values
array<string|int, mixed>

getDescription()

Get strategy description

public getDescription() : string
Tags
inheritDoc
Return values
string

getDuration()

public getDuration() : int|null
Tags
inheritDoc
Return values
int|null

getHandle()

public getHandle() : string
Tags
inheritDoc
Return values
string

getName()

public getName() : string
Tags
inheritDoc
Return values
string

setCache()

Set a block cache

public setCache(BlockInterface $block, string $data, TagDependency $dep) : mixed
Parameters
$block : BlockInterface
$data : string
$dep : TagDependency
Tags
inheritDoc
Return values
mixed

getViewPort()

Get user's view port

protected getViewPort() : string
Return values
string

Search results