Joint optimization of caching and recommendations