Our findings indicate that the deficiency of Casp11-GSDMD signaling pathways reverses infection-induced cognitive dysfunction. Here, SCAF11 is linked to infection.