Sub-optimal developmental diets often have adverse effects on long-term fitness and health. One hypothesis is that such effects are caused by mismatches between the developmental and adult environment, and may be mediated by persistent changes in gene expression. However, there are few experimental tests of this hypothesis. Here we address this using the fruit fly, Drosophila melanogaster. We vary diet during development and adulthood in a fully factorial design and assess the consequences for both adult life history traits and gene expression at middle and old age. We find no evidence that mismatches between developmental and adult diet are detrimental to either lifespan or fecundity. Rather, developmental and adult diet exert largely independent effects on both lifespan and gene expression, with adult diet having considerably more influence on both traits. Furthermore, we find effects of developmental diet on the transcriptome that persist into middle and old-age. Most of the genes affected show no correlation with the observed phenotypic effects of larval diet on lifespan. However, in each sex we identify a cluster of ribosome, transcription, and translation-related genes whose expression is altered across the lifespan and negatively correlated with lifespan. As several recent studies have linked decreased expression of ribosomal and transcription related proteins to increased lifespan, these provide promising candidates for mediating the effects of larval diet on lifespan. We place our findings in the context of theories linking developmental conditions to late-life phenotypes and discuss the likelihood that gene expression differences caused by developmental exposure causally relate to adult ageing phenotypes.