Being human, I think more about the number of dementia years than number of dementia-free years. Could having good dietary, sleep, and exercise habits result in living longer with dementia?
I've hard about cognitive reserve and how healthy lifestyle choices can build that. But I never read about ways to minimize the number of years you have to live with dementia. I wish I could sign an order that would grant me a dignified death once I'm deemed no longer fit to make that decision.
You're looking at this from the wrong angle. The dementia risk and longevity have overlapping factors. Lifestyle choices correlated with shorter lifespan are also correlated with earlier dementia onset. They're not perfectly proportional, but getting earlier dementia and also living shorter is lose-lose.
Technically there's an extreme version of this where someone's lifestyle is so bad that they're unlikely to live past 60, but the last 10-20 years of that life would not be fun.