There are three at risk periods when cows are more vulnerable to be infected with mastitis:
during milking, if teat preparation is not optimal,
after milking, if a cow has open sphincters and lies down in a dirty area
during the dry period
During milking, cows “share” the milking machine and it can be a source of contamination from one cow to another cow or one quarter to another quarter. That’s why cleaning and sanitizing the teats before milking is very important to reduce the infection risk.