Chicken soup, dry toast, ginger ale, or fluids only: everyone has their own advice for what you should eat - or not eat - when you're dealing with a nasty cold or stomach bug.

But now scientists have found evidence to suggest that a link really does exist between dietary changes and recovery time - and whether you should eat or fast could be determined by the kind of infection you're battling.

The findings, which have so far only been demonstrated in mice, suggest that eating more while combating a viral infection like the flu could help you get better faster, but if you've got a bacterial infection like food poisoning, eating might actually make things worse.

"When animals are infected, they stop eating, and they switch to a fasting metabolic mode," team leader Ruslan Medzhitov from Yale University told Ziba Kashef of YaleNews. "The question was whether fasting metabolism is protective or detrimental [in humans]."

Before jumping into the latest research, we should first go over how our bodies respond to different infections.

There are two types of infections that many of us succumb to every now and then: bacterial and viral.

Bacterial infections, which include ailments like bronchitis and pneumonia, are caused by single-celled organisms that can invade and thrive inside our bodies, reproducing on their own. Most bacterial infections can be treated with antibiotics that stop the colonies from growing larger.

Viral infections, such as the flu ( influenza) and the common cold (rhinovirus), on the other hand, do not replicate on their own like bacteria does. Instead, viruses take over our cells and hijack them to get them pumping out more copies of the virus, so it spreads through our bodies like a hostile takeover.

These type of infections also do not respond to antibiotics, though certain anti-viral medications can block their spread to new cells. 

When we get infected with harmful bacteria or a virus, our immune systems kick into gear, and their initial response usually involves increasing inflammation to various parts of the body. This - rather counterintuitively - puts a lot of extra stress on our already beleaguered bodies.

So although the immune system is generally great at killing off an invasion, it can sometimes go a little overboard.

And as Debora MacKenzie explains for New Scientist, recent research suggests that surviving infections can often have more to do with our ability to survive our own body's response to an infection, and not the infection itself.

Besides causing inflammation, both bacterial and viral infections can cause us to lose our appetites, but our hunger appears to return more quickly during viral infections than bacterial ones.

With this in mind, Medzhitov's team decided to investigate how eating during both types of infection could change recovery times.

The team performed a series of experiments on mice, which they injected with bacterial and viral molecules that are specially designed to trigger the same inflammatory responses that the infections do.

The then either administered or blocked the sugar glucose in the mice, to simulate one eating group and one fasting group.

They researchers found that both types of infections caused the mice to lose their appetites initially, but found that the mice that ate with viral infections recovered faster than those that ate with bacterial infections.

This suggests that the glucose helped protect the brains of the mice and other systems from inflammation.

On the other hand, all of the mice that ate with the bacterial infections actually ended up dying because the increased glucose levels led to brain damage, causing them to have seizures and eventual death.

So why are the results so dramatically different? The team says that this is likely because fasting triggers the liver to produce ketones - the molecules the body produces when it starts to burn fat for energy instead of sugars.

This is important, the team suggests, because bacterial infections cause free radicals - a type of highly reactive atom that can cause oxidative damage in other cells - to skyrocket in the brain, blocking neurons from taking in glucose, which, in turn, triggers seizures. Eating glucose during this time seems to make these free radical levels increase even higher, increasing seizure risk.

In other words, the mice didn't want to eat when they were battling a bacterial infection because it can be damaging. Instead, their bodies wanted to use fat reserves for fuel, which allows neurons to do their thing without causing further damage.

Interestingly, eating with the flu helped the mice recover because viral infections do not cause free radical increases in the brain. Instead, eating was just a normal process, allowing the mice to regain their strength.

Wrapping everything up, the team concludes that, based on their experiments, our bodies could be telling us what to do when we have an infection and we might want to listen to them.

It's important to note, though, that the team only used mice for their trials, and as we've seen in the past, similar research on human subjects can often yield vastly different results. It will take human trials to verify if the findings hold up or not.

Despite that, understanding how our bodies react to certain infections might help doctors better diagnose disease and prescribe proper treatments earlier, possibly saving lives down the road.

The team's findings were published in Cell.