Answer the question
In order to leave comments, you need to log in
How to implement automatic caching in the Bitrix component?
How to implement automatic caching in custom Bitrix components?
On the D7 core, components are inherited from the CBitrixComponent class, which implements the StartResultCache, EndResultCache, and AbortResultCache methods.
The signature of the StartResultCache method call does not imply some place for cache tagging, etc., how then to implement automatic cache clearing when updating elements (or categories) in the infoblock?
Answer the question
In order to leave comments, you need to log in
To mark the component cache with the infoblock dependency tag - inside the cached part (StartResultCache block) call:
$taggedCache = \Bitrix\Main\Application::getInstance()->getTaggedCache();
$taggedCache->registerTag('iblock_id_' . $iblockId);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question