Wearing caps while fielding in cricket is not compulsory, but it is a common practice. Players who wear hats mainly to protect their eyes from the sun.