There is a wide variety of resistance mechanisms that hosts may evolve in response to their parasites. These can be functionally classified as avoidance (lower probability of becoming infected), recovery (faster rate of clearance), tolerance (reduced death rate when infected), or acquired immunity. It is commonly thought that longer lived organisms should invest more in costly resistance. We show that due to epidemiological feedbacks the situation is often more complex. Using evolutionary theory we examine how the optimal investment in costly resistance varies with life span in a broad range of scenarios. In the absence of acquired immunity, longer lived populations do generally invest more in resistance. If hosts have acquired immunity, the optimal resistance may either increase or decrease with increasing life span. In addition, there may be evolutionary bistability with high and low investments in avoidance or tolerance. The optimal investment in the duration of acquired immunity always increases with life span, and due to bistability, shorter lived hosts may commonly not evolve any immunity. In contrast, the optimal investment in the probability of acquiring immunity initially increases and then decreases with life span. Our results have important implications for the evolution of invertebrate and vertebrate immunity, and for the evolution of acquired immunity itself.