As for others here, I find a strong espresso almost instantly relieves RLS in the middle of the night. On the other hand, too much coffee during the day definitely causes worsening of symptoms in the evening. By gradually lessening my daytime intake I find that two coffees in the morning and two in the afternoon is the max. Last one no later than 4pm. Until I discovered this, I was getting severe symptoms after taking medication (ropinirole); sometimes even hot bath did not work after onset. Now, take pills, wait and hour or so, go to bed. No probs.
Looking at the science of it all, it seems to me that the effect of coffee/caffeine is dependent on the timing of taking your drugs. Taken, relatively, soon after drug ingestion (early hours) it seems to reduce symptoms. Taken after the effect of the drug wears off (during the day), it will worsen them. That's the way it works for me, at least. Knowing the devious ways this condition works, however, it will be different/variable for every other sufferer! For what it's worth, have also renounced chocolate and cakes and sweet desserts. This seems to help but is very sad because I make a damn good sachetorte and tiramisu!
Tragedy is, I have just been to (private and expensive!) neurologist to get medication changed because of "augmentation". Now, well, it ain't broke any more, so I'll wait and see. The private route for neurologist was only option: waited two weeks for appointment. NHS wait is nine months! Was worth it though - just to find a medical professional who really understands RLS and knows what a life-changer and life-destroyer it can be. He described at as a "demon living inside you". Bloody right!