If you've ever had surgery, you'll probably recall waking up feeling groggy as the anesthetic wore off. The feeling fades, but not for everyone – some people also experience an abrupt decline in brain function post-op that can last weeks to months.

A new animal study suggests that eating fatty foods in the days before surgery could make the inflammatory processes linked to that cognitive decline worse, prolonging the memory difficulties that in humans, can lead to an increased risk of dementia.

Past research in humans has shown that fatty foods alone can hasten cognitive decline which is usually associated with aging, by triggering inflammation. Even the occasional sugary treat or fatty feast can impact brain function, other animal studies show.

In the new study from a team of researchers at Ohio State University, rats fed fatty foods for just three days before surgery showed persistent signs of memory deficits lasting up to two weeks. This was accompanied by a rush of inflammation in the brain, which lingered for three weeks.

"These data suggest that these multiple insults have a compounding effect," says behavioral neuroscientist Ruth Barrientos of Ohio State University.

"The high-fat diet alone might increase inflammation in the brain just a little bit, but then you have surgery that does the same thing, and when put together in a short amount of time you get a synergistic response that can set things in motion toward a longer-term memory issue."

To get those results, the team fed young and old rats a high-fat or standard diet for three days before a procedure resembling exploratory abdominal surgery. The control groups were anesthetized but had no surgery. Two weeks later, all animals were put through a series of memory tests.

The memory problems seen in both young and older rats fed high-fat diets lingered at least two weeks post-surgery – a longer-lasting effect than researchers have seen in rodents before and after just 3 days, not weeks, of eating unhealthy food.

These effects were not related to the anesthesia, the researchers determined, because other animals fed a fatty diet but spared any anesthetic or surgery showed similar memory deficits from just unhealthy food alone.

Further studies will be needed to figure out how long these cognitive effects last, and how post-op opioid painkillers such as morphine prolong these effects.

On the flip side, the researchers found one month of DHA omega-3 fatty acid supplements blunted the post-surgery inflammatory response, and prevented the associated memory problems in both young and older rats.

"DHA was really effective at preventing these changes," Barrientos says. "And that's amazing – it really suggests that this could be a potential pretreatment, especially if people know they're going to have surgery and their diet is unhealthy."

However, it's unclear how the results of this animal study would translate to humans, especially obese surgical patients, not just the occasional unhealthy eater.

What's more, the study only used male rats when other research suggests that men and women respond differently to general anesthetics used in surgery.

The study has been published in Brain, Behavior, and Immunity.