Сброс всего кеша сайта через API в 1С-Битрикс

// >= iblock 15.0.7
if (method_exists(‘\CIBlock’, ‘clearIblockTagCache’)) {

\CIBlock::enableClearTagCache();

foreach ($iblockIds as $iblockId) {
\CIBlock::clearIblockTagCache($iblockId);
}

\CIBlock::DisableClearTagCache();
} else {

BXClearCache(true);

(new \Bitrix\Main\Data\ManagedCache())->cleanAll();

(new \CStackCacheManager())->CleanAll();
}

if (
method_exists(‘\CHTMLPagesCache’, ‘IsCompositeEnabled’)
&& \CHTMLPagesCache::IsCompositeEnabled()
) {
\CHTMLPagesCache::CleanAll();
}