IL1B and mastitis: • In the context of S. aureus exposure, there was an observable increase in the expression of NLRP3, ASC, caspase-1, caspase-1 p20, and pro-IL-1β, thus intensifying the inflammatory response.• Conversely, the supplementation of selenium exerted a substantial inhibitory effect on the levels of NLRP3, ASC, caspase-1, caspase-1 p20, and pro-IL-1β.• This outcome stands as compelling evidence that selenium treatment serves as a preventive measure against S. aureus-induced mastitis in mice, achieved by effectively curtailing the NLRP3 level.