With my knitted wool items, I usually fill a tub with cool water and use a squirt of shampoo! Aggitate the shampoo in the water before you add the cap. Allow to soak a few minutes. You may gently squeeze the soapy water through the cap, but you don't want to create a lot of friction. Rinse in water of the same temperature.
I usually roll my knits in a towel, or you could gently press out extra water between towels. I don't know what type of cap--you may be able to just lay it flat to dry--just shape it gently if needed with your fingers. If I need to "shape" something, I might stuff it with balled up plastic grocery bags!