Personally I am usually okay simply washing the exterior before prepping, because I rarely see bugs inside the tightly packed leaves. However, if it seems dirty inside, I will wash cabbage after it has been cut, chopped, or shredded, then dry thoroughly with a salad spinner, then with kitchen towels, then air drying briefly. I don't like to wash cabbage right before making salad type dishes, because I don't want the possibility of watering down the dressing with excess moisture. If you're using the vegetable for soups, then it doesn't matter when you wash.