It’s not fasting, it’s caloric restriction that contributes to longevity. We’ve got studies on yeast, fruit flies, mice, rhesus monkeys, maybe some other stuff, but the only one I can find not behind a paywall is the fruit flies.
Behavioral, physical, and demographic changes in Drosophila populations through dietary restriction
And here’s a an overview that links to a bunch of paywalled studies
Intermittent and periodic fasting, longevity and disease
‘Evidence is accumulating that eating in a 6-hour period and fasting for 18 hours can trigger a metabolic switch from glucose-based to ketone-based energy, with increased stress resistance, increased longevity, and a decreased incidence of diseases, including cancer and obesity.’
Effects of Intermittent Fasting on Health, Aging, and Disease, NEJM 2019