Behind the eye could be a ophthalmological migraine (sometimes these can cause vision loss or other strange visual effects (migraine aura)). Those who experience photosensitive migraines can experience the migraine in the eye or visual parts of the brain or it could be a migraine that's in another part of the brain that is triggered physiologically and/or dermatologically by light. I wouldn't recommend caffeine if you are having migraines as it stimulates certain receptors that may actually be causing your migraine and the consumption of caffeine may make it worse - or not, depending.
And due to the inverse square law and low voltages of a wifi transmitter and your very own skull, you can be sure that wifi doesn't actually affect your brain. You're more likely to be affected by everyday cosmic background radiation which has around the same wavelength. It can have a psychological effect, however. Working with computers screens for too long everyday can also cause eye strain, headaches and even visual snow.
I'd recommend you see a general doctor and an ophthalmologist if this persists.
You can't really but sure how to cure it unless you know what's causing it - jumping to conclusions can be harmful. You may just have a persistence cold or are neglecting a certain thing your body happens to need - that includes dietary things.