Caffeine can relieve migraine headaches, but there’s a catch. The relationship between caffeine and headaches is complicated. The truth is that caffeine can be both a trigger and remedy for headaches, depending on how much and how frequently you consume it.