Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can create a function which clear the cache of a specified page, following code is needed:</p> <p>TYPO3 6.0 </p> <pre><code>public function clearCache($cacheCmd) { /** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */ $tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance("TYPO3\\CMS\\Core\\DataHandling\\DataHandler"); $tce-&gt;stripslashes_values = 0; $tce-&gt;start(array(), array()); switch($cacheCmd) { case 'pages': case 'all': $tce-&gt;admin = 1; } $tce-&gt;clear_cacheCmd($cacheCmd); unset($tce); } </code></pre> <p>TYPO3 4.x </p> <pre><code>public function clearCache($cacheCmd) { /** @var $tce t3lib_TCEmain */ $tce = t3lib_div::makeInstance("t3lib_TCEmain"); $tce-&gt;stripslashes_values = 0; $tce-&gt;start(array(), array()); switch($cacheCmd) { case 'pages': case 'all': $tce-&gt;admin = 1; } $tce-&gt;clear_cacheCmd($cacheCmd); unset($tce); } </code></pre> <p>And <code>$cacheCmd</code> can have following values: <code>/typo3/sysext/core/Classes/DataHandling/DataHandler.php:clear_cacheCmd</code> (> 6.0) or <code>/t3lib/class.t3lib_tcemain.php</code> (4.x)</p> <pre class="lang-php prettyprint-override"><code>/** * Clears the cache based on the command $cacheCmd. * * $cacheCmd='pages': Clears cache for all pages. Requires admin-flag to * be set for BE_USER. * * $cacheCmd='all': Clears all cache_tables. This is necessary if * templates are updated. Requires admin-flag to be set for BE_USER. * * $cacheCmd=[integer]: Clears cache for the page pointed to by $cacheCmd * (an integer). * * $cacheCmd='cacheTag:[string]': Flush page and pagesection cache by given tag * * $cacheCmd='cacheId:[string]': Removes cache identifier from page and page section cache * * Can call a list of post processing functions as defined in * $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'] * (numeric array with values being the function references, called by * \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction()). * * Note: The following cache_* are intentionally not cleared by * $cacheCmd='all': * * - cache_md5params: RDCT redirects. * - cache_imagesizes: Clearing this table would cause a lot of unneeded * Imagemagick calls because the size informations have * to be fetched again after clearing. * * @param string $cacheCmd The cache command, see above description * @return void */ </code></pre> <p>Call this with a userFunc if a given parameter is set in typoscript or create a simple extension by your own.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload