Cache resolved instances or references when using the ContainerAwareTrait trait