Craft Themes (3.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()  : 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

Properties

Methods

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