[TASK] Performance improvement on consecutive cache clearing

Prevents repeating cache clearing twice in the same ObjectContainer scope.
Merge pull request #162 from NamelessCoder/cacheclearperformance

[TASK] Performance improvement on consecutive cache clearing