Mild or transient dietary restriction (DR) improves many aspects of health and aging. Emerging evidence from us and others has demonstrated that DR also optimizes the development and quality of immune responses. However, the factors and mechanisms involved remain to be elucidated. Here, we propose that DR-induced optimization of immunological memory requires a complex cascade of events involving memory T cells, the intestinal microbiota, and myeloid cells. Our findings suggest that DR enhances the ability of memory T cells to recruit and activate myeloid cells in the context of a secondary infection. Concomitantly, DR promotes the expansion of commensal Bifidobacteria within the large intestine, which produce the short-chain fatty acid acetate. Acetate conditioning of the myeloid compartment during DR enhances the capacity of these cells to kill pathogens. Enhanced host protection during DR is compromised when Bifidobacteria expansion is prevented, indicating that microbiota configuration and function play an important role in determining immune responsiveness to this dietary intervention. Altogether, our study supports the idea that DR induces both memory T cells and the gut microbiota to produce distinct factors that converge on myeloid cells to promote optimal pathogen control. These findings suggest that nutritional cues can promote adaptation and co-operation between multiple immune cells and the gut microbiota, which synergize to optimize immunity and protect the collective metaorganism.