I've got numerous scars on my scalp from bumping my head on sharp metal edges while crawling around inside or under farm equipment, even though I always wear a cloth, baseball-style cap. That's no big deal to those of you with luxuriant manes of manly hair, but my poor bald pate has enough scars so it looks like somebody's been playing tic-tac-toe up there. Two or three games. Children point at my head and say, "Look, Mommy," when I sit in movie theaters.
So I was really appreciative when our bosses supplied us with safety cap liners. They're a thin, rounded plastic liner that fits inside traditional baseball-style caps. You can find them on the internet by searching for "cap safety liner." Manufactured by Erb, Bullard and other safety equipment companies, they sell for around $5 or $6.
They're not something you'll put in your cap and wear all the time, because they get too sweaty, but they're easy to put in your cap for as long as you're working in places without a lot of head clearance.
They aren't hard-hat-quality, but they reduce the annoyance of poking or gashing your head enough to bring blood. However--there will be blood. Because you'll usually poke your head once before you decide it's worth finding and slipping the safety liner inside your cap.
At least that's my experience. You'd think I'd be wise and experienced enough after all these years to anticipate and take action to prevent pain in situations that could cause contusions. Apparently not.