Caffeine headaches really are terrible (I broke a 20 year caffeine habit on my first MC, cold turkey) but PLEASE don't do the Master-Cleanse and drink coffee. You're just defeating the purpose and the caffeine will be even more poisonous to your body if you drink it while cleansing. Either drink less coffee prior to the cleanse or suffer through it.
That said, during my first MC, I had such a bad headache that I did take one or two aspirin one day. It was either that or go off the MC, and I decided on the former. I know I didn't get as much cleansing as I would have, but I still learned from the experience. The thing is, I hadn't PLANNED on taking the aspirin, but felt I had to do it later. Know what I mean? If you plan to take aspirin or drink coffee, you're sort of setting yourself up for failure because undoubtedly you'll do it, whereas if you tell yourself you WON'T take anything, you may surprise yourself.