Distance from goal is surely irrelevant. There were no covering players between Ayew and the goal, CK did not give a foul for Ayew's challenge on Silva, therefore red card was appropriate for DOGSO.
Let's be brutally honest. Silva probably saved Ayew the embarrassment of yet another miss. He is hardly prolific when it comes to scoring goals.
I thought that Ayew fouled Silva, soft perhaps, however, in the modern game, it was a foul, although I honestly don't know how the different officials are coming to decisions these days. It is obvious from the comments on this board that confusion reigns.