Many adult traits in Drosophila melanogaster show phenotypic plasticity, and the effects of diet on traits such as lifespan and reproduction are well explored. Although plasticity in response to food is still present in older flies, it is unknown how sustained environmental variation affects life-history traits. Here, we explore how such life-long fluctuations of food supply affect weight and survival in groups of flies and affect weight, survival and reproduction in individual flies. In both experiments, we kept adults on constant high or low food and compared these to flies that experienced fluctuations of food either once or twice a week. For these 'yoyo' groups, the initial food level and the duration of the dietary variation differed during adulthood, creating four 'yoyo' fly groups. In groups of flies, survival and weight were affected by adult food. However, for individuals, survival and reproduction, but not weight, were affected by adult food, indicating that single and group housing of female flies affects life-history trajectories. Remarkably, both the manner and extent to which life-history traits varied in relation to food depended on whether flies initially experienced high or low food after eclosion. We therefore conclude that the expression of life-history traits in adult life is affected not only by adult plasticity, but also by early adult life experiences. This is an important but often overlooked factor in studies of life-history evolution and may explain variation in life-history experiments.