A recent study found that fasting or a ketotic state was beneficial and limiting to bacterial infections. It was found that limiting sugar was the key (as always). It was found that excess sugar actually lowered the immune system and increased inflammation in the body. When researchers provided sugar/glucose for the infected tissues the tissues actually died. And died almost immediately when absent a hyperthermic environment i.e. a fever. Which is why you should allow most fevers to run their course and not limit them with over the counter NSAIDS. Proof you should "Starve a Fever".
The opposite was found to be the case for Viral infections or in other words the common cold and flu. Research found that when nutrition is limited during a viral infection the host tissues will die regardless of environment. It was found that the body will actually search out stored glucose in the body to fend off the infection. The glucose was required to combine with the body's natural virus killers to work, in other words it was necessary and required for the body to have food to survive. So in my gramma Giggy's words "Stuff a Cold". (miss you gramma)