Do not forget that the managed cache of infoblocks is cleared only if CIBlockElement::Update is called. For example, if properties are changed using CIBlockElement::SetPropertyValueCode, cache will not be cleared. After using CIBlockElement::SetPropertyValueCode() the following code shall be executed: