see what you need to do is go down to the beach and get yourself some sand
pour some sand into your washing machine into the compartment where you would normally put the detergent
take a paintbrush and coat the inside of the drum of your washing machine with glue, and then stick a layer of sand to the glue
take the remaining sand and rub it into the inside of your cap vigorously to remove deep seated drops of sweat
put the cap into the washing machine and wash on a mixed load cycle at 1200 rpm at a temperature of 40 degrees celsius
while it is being washed, stand next to your washing machine and look down at the floor while singing a bob marley song in an irish accent
your cap should now emerge from the washing machine free of any sweat or bad smell
hope this helps