On the optimality of coded caching with heterogeneous user profiles