We investigated the mean-free path effects on the magnetoresistance of ferromagnetic nanocontacts. For most combinations of parameters the magnetoresistance monotonously decreases with increasing the contact cross-section. However, for a certain choice of parameters the calculations show non-monotonous behavior of the magnetoresistance in the region in which the diameter of the contact becomes comparable with the mean-free path of electrons. We attribute this effect to different conduction regimes in the vicinity of the nanocontact: ballistic for electrons of one spin projection, and simultaneously diffusive for the other. Furthermore, at certain combinations of spin asymmetries of the bulk mean-free paths in a heterocontact, the magnetoresistance can be almost constant, or may even grow as the contact diameter increases. Thus, our calculations suggest a way to search for combinations of material parameters, for which high magnetoresistances can be achieved not only at the nanometric size of the contact, but also at much larger cross-sections of nanocontacts which can be easier for fabriaction with current technologies. The trial calculations of the magnetoresistance with material parameters close to those for the Mumetal-Ni heterocontacts agree satisfactorily with the available experimental data.