A friend had a problem - after every baby, she regularly got mastitis and UTIs, usually not simultaneously, but each as frequently as every month. It didn't happen during pregnancy, fortunately, but she couldn't seem to prevent it afterwards. Her mom had the same tendency and said the family "ductwork" was subpar.
She tried all the things - drinking more water, going to the bathroom more frequently, cutting out coffee, tea, chocolate, sugar, avoiding tight clothing and sleeping on her stomach, letting the baby nurse frequently, taking vitamin C and grapefruit seed extract and D-mannose when she felt herself getting sick.
All these interventions helped her to catch it and often prevent it from becoming a trip to the doctor, but the timeline from "I feel a little blah" to "I have a fever and flu-like symptoms and burning sensations" might still be a matter of hours rather than days.
It seemed that something about her immune system wasn't working properly, if all these measures weren't enough to prevent it, just slow the course a bit. It likely relates to hormones being lower while nursing a newborn as well. So I went down the rabbit hole for a couple of days trying to figure out the ways in which the immune system changes between pregnancy and delivery, and realized it was going to be a dissertation and there was probably a simpler solution.
We talked about taking D-Mannose on a daily maintenance schedule, which many people prone to UTIs do, and taking multivitamins as reliably when nursing just as she does when pregnant. Since she tolerates dairy well, we looked for brands that contained the right strains to build resistance to UTIs.
And then I had an idea that Zinc might be helpful - partly because it changes the pH of urine, partly because it builds general immunity, partly because her fever spiked so rapidly. So she added elderberry and zinc lozenges to her routine, every few days. She's still maintaining most of her other routines - though she can have a bit of coffee or tea - and it's been 5 months since her baby was born. No UTIs, no mastitis - it's her personal record!
Even if her exact protocol isn't the tipping point for you or another mom you know, I hope this encourages you to keep experimenting and get new ideas to arrive at a solution.