Added cache mechanism due to double request from Apigility.

The cache can be put in private instead of public. It is a hot patch and not a definitive fix, as Doctrine should be configured and called in a way that results are cached by Doctrine itself.