Squid as a proxy has more functionality than nginx. In any case, everything really depends on the specifics of caching. If all intermeddle in what he does nginx I would use it. In any case, there is no problem to stick the first squid and to collect statistics on response peaks, and then nginx on the basis of these data to make a decision.