Breast carcinoma and lactation

Lactating breasts can go through a lot - engorgement, ‘blocked ducts’, inflammation, infectious mastitis, abscess formation, milk retention and cysts, etc.

So how is it that breastfeeding is reported as protective against breast cancers? Does breastfeeding provide any protection against the development of BC in the immediate/short term, or are we just looking at a reduced lifetime risk of BC, in spite of everything that lactating breasts go through?