‪TYPO3CMS  ‪main
TYPO3\CMS\Redirects\Hooks\DataHandlerCacheFlushingHook Class Reference

Public Member Functions

 rebuildRedirectCacheIfNecessary (array $parameters, DataHandler $dataHandler)
 

Detailed Description

Ensure to clear the cache entry when a sys_redirect record is modified or deleted

This class is a specific TYPO3 hook implementation and is not part of the Public TYPO3 API.

Definition at line 30 of file DataHandlerCacheFlushingHook.php.

Member Function Documentation

◆ rebuildRedirectCacheIfNecessary()

TYPO3\CMS\Redirects\Hooks\DataHandlerCacheFlushingHook::rebuildRedirectCacheIfNecessary ( array  $parameters,
DataHandler  $dataHandler 
)

Check if the data handler processed a sys_redirect record, if so, rebuild the redirect index cache

Todo:
‪This hook is called for each record which needs to clear cache, which means this gets called for other records than sys_redirects, but also for each sys_redirect record which has been modified with this DataHandler call. Even if we can narrow down to rebuild only for specific source_hosts, this still means that we eventually rebuild the "same" cache multiple times. Find a better way to aggregate them and rebuild only once at the end.

Definition at line 41 of file DataHandlerCacheFlushingHook.php.

References TYPO3\CMS\Core\DataHandling\DataHandler\getHistoryRecords(), and TYPO3\CMS\Core\Database\Connection\PARAM_INT.