‪TYPO3CMS  ‪main
TYPO3\CMS\Frontend\Event\BeforePageCacheIdentifierIsHashedEvent Class Reference

Public Member Functions

 __construct (private readonly ServerRequestInterface $request, private array $pageCacheIdentifierParameters,)
 
 getRequest ()
 
 getPageCacheIdentifierParameters ()
 
 setPageCacheIdentifierParameters (array $pageCacheIdentifierParameters)
 

Detailed Description

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).

Definition at line 36 of file BeforePageCacheIdentifierIsHashedEvent.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Event\BeforePageCacheIdentifierIsHashedEvent::__construct ( private readonly ServerRequestInterface  $request,
private array  $pageCacheIdentifierParameters 
)

Definition at line 38 of file BeforePageCacheIdentifierIsHashedEvent.php.

Member Function Documentation

◆ getPageCacheIdentifierParameters()

TYPO3\CMS\Frontend\Event\BeforePageCacheIdentifierIsHashedEvent::getPageCacheIdentifierParameters ( )

Definition at line 48 of file BeforePageCacheIdentifierIsHashedEvent.php.

◆ getRequest()

TYPO3\CMS\Frontend\Event\BeforePageCacheIdentifierIsHashedEvent::getRequest ( )

Definition at line 43 of file BeforePageCacheIdentifierIsHashedEvent.php.

◆ setPageCacheIdentifierParameters()

TYPO3\CMS\Frontend\Event\BeforePageCacheIdentifierIsHashedEvent::setPageCacheIdentifierParameters ( array  $pageCacheIdentifierParameters)

Definition at line 53 of file BeforePageCacheIdentifierIsHashedEvent.php.