Keeping your knees pain-free may have as much to do with what you eat as what you do.

Ever since my running days some decades ago, I have had reoccurring knee pain and seen my share of specialists. A few years ago, walking became so painful that I had several months of physical therapy and have been consistent with the strengthening routine my therapist prescribed ever since.

My knees are still sensitive. I know not to push it with exercises that are jarring and stick to low-impact workouts like walking, swimming or dancing without too much jumping about. In my personal yoga practice, I pay careful attention to which postures I do and to my alignment when I do them. Day to day, I am conscious of how I walk and turn.

Despite all these precautions, I never really know when my knees may start hurting.

Recently, I was helping a yoga student who was new to my class modify a posture so it wouldn't bother his sensitive knees. When we compared notes after class, he mentioned how he noticed that his knees weren't just affected by his movements but also by drinking wine the day before.

While I'd heard of improving joint health with dietary supplements and have even taken things such as glucosemia and collagen, I hadn't really considered that what I ingest could trigger knee pain. Some recent research shows that diet — along with proper exercise and posture — plays a significant role in maintaining healthy knees.

Why diet matters to your knees

When it comes to knees, research shows that the most important reason for watching what you eat is to maintain a healthy body weight. Each pound of weight gain translates to between three and four pounds more impact in the knee. If you run or do other high impact sports, the force your knees experience is even greater.

However, if you're looking to reduce knee pain, your food choices need to go beyond what helps you slim down or keep weight off. Certain foods contain properties that have been proven to boost joint health by preventing inflammation, protecting joints from damage, building connective tissue and reducing joint stiffness, reports nutritional therapist Kerry Torrens in BBC’s GoodFood.

She recommends including foods with healthy omega-3 fats at least twice per week to take advantage of their anti-inflammatory properties. Along with fatty fish like salmon and halibut, other great sources are nuts and seeds, including chia the most potent seed of all.

Certain fruits and vegetables pack more punch than their counterparts. Apples with the peel still on have a natural anti-histamine called quercetin, while leafy green vegetables such as kale have a compound called sulforaphane thought to protect joints from damage. Consider spicing up your recipes with turmeric, found in curry, and ginger as both contain potent anti-inflammatory compounds.

On the other hand, some foods and drinks are known to trigger allergic reactions that cause inflammation and pain in the joints, according to an article on the American Fitness Professionals and Associates (AFPA) website. Along with processed foods containing additives, these includes cereal grains, dairy products, tea, coffee, red meats and citrus fruit.

The BBC article added tomatoes and peppers to the list of foods that some arthritis sufferers have reportedly omitted from their diets with positive results.

"Because there is no scientific evidence yet to support these claims, it may be worth keeping a food diary to see what works for you," Torrens writes. "Don't omit any major food groups from your diet without seeking the advice of your GP or dietician first."

Lifestyle choices spur controversy

In a study of Scottish senior citizens over the course of four years, obesity showed a detrimental effect on self-reported knee pain, yet neither smoking nor alcohol consumption did. To the contrary, recent studies including one of more than 40,000 inhabitants of Melbourne, Australia, who had no previous knee injuries found smoking to be associated with increased loss of knee cartilage and cartilage damage.

Alcohol and carbonated beverages are included in the APFA "to avoid" list for arthritis sufferers. Alcohol increases uric acid in the system as well as dehydration due to its diuretic nature. This could have been what affected the knees of the yoga student who reported soreness the day after drinking a couple more glasses of wine than usual.

One study associated the frequent consumption of sweetened soft drinks with increased progression of radiographic knee osteoarthritis in men.

"Our main finding is that in general, the more sugary soda men drink, the greater the risk that knee osteoarthritis will get worse," says researcher Bing Lu, M.D., assistant professor of medicine at Harvard Medical School.

What about coffee?

Coffee can be found on both the pro and con side of the joint health equation.

A widely cited Finnish study found that the number of cups of coffee people drank each day was directly proportional to their risk of developing rheumatoid arthritis, a common cause of joint pain. However, subsequent studies that controlled other lifestyle factors came up with distinct results, and some even showed moderate coffee consumption to decrease the risk a various diseases including ones linked to joint pain, writes Jon Williams in Livestrong.

It's improbable that one study is going clarify definitively what you should consume for your knees to stay or get healthy. Such research is helpful in pointing out that in some cases there is a correlation between ingesting a certain food or nonfood substance and joint pain. Using that information, you can begin to investigate whether it applies to you.

"Just as each person's pain is unique, so are his or her reactions to certain foods. Books about treating pain with diet may agree on some things, but they all give different prescriptions for what to eat," David Spero, RN, writes in Painfree Living.

Along with logging the food you eat and levels of pain felt each day, Spero recommends using an elimination diet to get to the core of what triggers pain for you in particular.