Registry::clearCacheHook() 

\nn\t3::Registry()->clearCacheHook($classMethodPath = ''); 

Inserts a hook that is executed when you click on "Clear cache". The following script is added to the ext_localconf.php of your extension:

\nn\t3::Registry()->clearCacheHook( \My\Ext\Path::class . '->myMethod' );
Copied!

| @return void

Source Code 

public function clearCacheHook( $classMethodPath = '' )
{
	$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][] = $classMethodPath;
}
Copied!