BeforePageCacheIdentifierIsHashedEvent

FinalYes

This event is dispatched just before the final page cache identifier is created, that is used to get() - and later set(), if needed and allowed - the page cache row.

The event retrieves all current arguments that will be part of the identifier calculation and allows to add further arguments in case page caches need to be more specific.

This event can be helpful in various scenarios, for example to implement proper page caching in A/B testing.

Note this event is always dispatched, even in fully cached page scenarios, if an outer middleware did not return early (for instance due to permission issues).

Table of Contents

Methods

__construct()  : mixed
getPageCacheIdentifierParameters()  : array<string|int, mixed>
getRequest()  : ServerRequestInterface
setPageCacheIdentifierParameters()  : void

Methods

__construct()

public __construct(ServerRequestInterface $request, array<string|int, mixed> $pageCacheIdentifierParameters) : mixed
Parameters
$request : ServerRequestInterface
$pageCacheIdentifierParameters : array<string|int, mixed>

getPageCacheIdentifierParameters()

public getPageCacheIdentifierParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRequest()

public getRequest() : ServerRequestInterface
Return values
ServerRequestInterface

setPageCacheIdentifierParameters()

public setPageCacheIdentifierParameters(array<string|int, mixed> $pageCacheIdentifierParameters) : void
Parameters
$pageCacheIdentifierParameters : array<string|int, mixed>

        
On this page

Search results