Cache should be set on metadata factory.