Caffeine can have positive effects on migraines and tension headaches. There is even medication which contains a combination of caffeine and painkillers. However, the brain becomes used to too much caffeine (>200mg caffeine, roughly two cups of coffee) after only two weeks. Caffeine has therefore less of an effect the more of it you consume. If migraine attacks and tension headaches occur on the weekend, you should test to see whether your caffeine consumption changes on the weekend and whether the migraines could be a symptom of withdrawal. You can easily document these factors with M-sense. One more tip: if you usually drink lots of coffee, espresso, or tea, try making them slightly weaker.