Researchers found fibre from fruit and vegetables to be the most beneficial for preventing breast cancer.
According to the major study, for each additional 10 grams of fibre consumed daily by young women, breast cancer risk dropped by 13%.
This equates to eating roughly one apple and two slices of wholewheat bread, or half a cup each of cooked kidney beans and a portion of cooked cauliflower.
Breast cancer is the most common cancer in the UK.
In fact, in 2012 there were roughly 50,800 new cases of breast cancer in women - that's around 140 women being diagnosed every day.
Adolescence or early adulthood in women is a period when breast cancer risk factors appear to be particularly important, according to scientists.
Researchers at Harvard T.H. Chan School of Public Health studied 90,534 women who had previously participated in the 'Nurses' Health Study II' - a long-running investigation of factors that influence women's health.
In 1991, the women (who were then aged 27-44) filled out questionnaires about their food intake and did so every four years. In 1998, they filled out a questionnaire about their diet during secondary school.
The researchers from Harvard analysed women's fibre intake and found that breast cancer risk was 12-19% lower among women who consumed more dietary fibre in early adulthood.
High fibre intake during adolescence was also associated with a 16% lower risk of overall breast cancer and 24% lower risk of breast cancer before menopause.
Among all of the women, there was a strong link between fibre intake and breast cancer incidence.
For each additional 10 grams of fibre consumed daily, breast cancer risk dropped by 13%.
The greatest benefit, however, came from fruit and vegetable fibre.
The authors believe eating more fibre-rich foods could lessen breast cancer risk partly by helping to reduce high oestrogen levels in the blood, which are strongly linked with breast cancer development.
"This work on the role of nutrition in early life and breast cancer incidence suggests one of the very few potentially modifiable risk factors for premenopausal breast cancer," said Maryam Farvid, visiting scientist at Harvard Chan School and lead author of the study.
Walter Willett, professor of Epidemiology and Nutrition at Harvard Chan School and senior author of the study, said: "From many other studies we know that breast tissue is particularly influenced by carcinogens and anticarcinogens during childhood and adolescence.
"We now have evidence that what we feed our children during this period of life is also an important factor in future cancer risk."
The study was published in The Journal Of Pediatrics.
Also on HuffPost: