The present disclosure provides a TO-CAN cap. The TO-CAN cap includes a casing, the casing has a hollow cylindrical structure, and an inner wall of the casing has a protrusion portion at a first end portion in an axial direction of the casing; and an optical lens, the optical lens has an optical portion for refracting light and a rib portion at a periphery of the optical portion, a side surface of the rib portion having a concave portion complementary to the protrusion portion, where the casing and the optical lens are connected to each other through the protrusion portion and the concave portion.