A basic function of public pension systems is to guarantee a satisfactory old-age income for short-sighted low earners. In proportional (i.e., earnings-related) systems, this requires a sufficiently high contribution rate. At the same time, there should be a cap on the pension contribution base to leave sufficient room for the efficient private savings of prudent high earners. Taking into account the dependence of life expectancy on the earnings (figuratively called longevity gap), a well-chosen cap has an additional advantage: it limits the unintended income redistribution from the short-lived to the long-lived. Our strongly stylized model is able to illustrate numerically the impact of the contribution rate and of the cap on the social welfare and the unintended income redistribution.