I generally don't use cavs on the front lines after I get tanks. In my last game, I had about 100 vet and elite cavs sitting around, doing nothing, so I sent them against the most backward civ in the game (who had just finished researching Fudalism). I also sometimes use them to mop up any workers, etc that I can find. I've pillaged, I've attacked the spearman that's left after the tanks killed the infantry in the enemy city, used them for spotters for my bombers, and things like that. Yeah, I'm smart enough to know that 20 cavs are probably not going to do much against infantry or mech infantry that's fortified inside a city or metro. Of course, I don't usually get into that situation, because I'm usually ahead in tech and beat everyone to MT and Nationalism.