The behavior of certain weighted Hardy-type operators on rearrangement-invariant function spaces is thoroughly studied with emphasis being put on the optimality of the obtained results. First, the optimal rearrangement-invariant function spaces-that is, the best possible function spaces within the class of rearrangement-invariant function spaces-guaranteeing the boundedness of the operators from/to a given rearrangement-invariant function space are described. Second, the optimal rearrangement-invariant function norms being sometimes complicated, the question of whether and how they can be simplified to more manageable expressions, arguably more useful in practice, is addressed. Last, iterated weighted Hardy-type operators are also studied.Besides aiming to provide a comprehensive treatment of the optimal behavior of the operators on rearrangement-invariant function spaces in one place, the paper is motivated by its applicability in various fields of mathematical analysis, such as harmonic analysis, extrapolation theory or the theory of Sobolev-type spaces.