The centralized coded caching problem is studied for the two-user scenario, considering heterogeneous cache capacities at the users and private channels from the server to the users, in addition to a shared channel. Optimal caching and delivery strategies that minimize the worst-case delivery latency are presented for an arbitrary number of files. The converse proof follows from the sufficiency of file-index-symmetric caching and delivery codes, while the achievability is obtained through memory-sharing among a number of special memory-capacity pairs. The optimal scheme is shown to exploit the private link capacities by transmitting part of the corresponding user`s request in an uncoded fashion. When there are no private links, the results presented here improve upon the two known results in the literature, namely: 1) equal cache capacities and arbitrary number of files and 2) unequal cache capacities and two files. The results are then extended to the caching problem with heterogeneous distortion requirements.