Implement caching of entities