I often take painkillers (acetaminophen aka paracetamol), but I've noticed that it's much more effective if I take them TOGETHER with my ADHD medication (ritalin aka methylphenidate) + my morning coffee. If I don't take them AT the same time, the painkiller is far less effective.
I do not exceed the maximum dosage of painkiller (1gram per intake, mornings), but alone this would barely suffice to kill my morning headache.
My hypothesis is that since the LIVER has to convert all three, I am effectively overdosing on either substance (painkiller or ADHD meds), and damaging my liver in the process.
Generally when you take medicine with high acidity food, like coffee, it will break down your medicine prematurely - you won't get as strong as an effect. I had to stop taking my Vyvanse with orange juice because it basically nullified the medicine.
Talk to your doctor. I had chronic headaches that I found out were related to low blood pressure and dehydration. Drinking water instead of diuretics, like coffee, immensely helped me.