[TASK] Performance improvement on consecutive cache clearing

Prevents repeating cache clearing twice in the same ObjectContainer scope.