When I go for a long ride all I do for energy is to take a GU flask and fill it, not with GU or some other expensive junk, instead I fill it with black dark roasted (dark as less acid) espresso that I make at home by mixing 80% Arabica beans and 20% Robusta. Then I drink about an 1/4 ounce of it about an hour into the ride and another 1/4 an ounce every 20 minutes to a 1/2 hour after that, but I also drink a small 4 ounce cup of espresso about 1 hour before the long ride starts. I don't know how scientific what I'm doing is, it's just something I created from reading other sources, but it seems to help on long rides.
This is something I found on the internet today so I haven't tried it yet, but I will!
Best pre-ride: Double Espresso; 185mg caffeine, 6cal, 0.4g protein, 0.8g carbohydrate, 0.2g fat.
Best mid-ride: Medium Americano (with a splash of skimmed milk); 277mg caffeine, 18cal, 1.6g protein, 2.6g carbohydrate, 0.3g fat.
Best for recovery: Medium Mocha (with full fat milk); 75mg caffeine, 301cal, 10.7g protein, 57.4g carbohydrate, 11.3g fat. (Chocolate milk is very good for a recovery drink and it's cheaper than buying those bike boutique mixes and better for you, I'm also not sure about the caffeine being necessary for a recovery drink, I have to research that more, but I do know this, if you drink a recovery drink with that much caffeine in it and need to go to sleep in less than 6 hours you may have problems sleeping and sleep is very important for recovery.)
The only way caffeine works though is that you can't be a heavy coffee drinker because if you are your body will be immune to the effects of the caffeine. So if your the type that drinks a 24 ounce Starbucks 2 times a day then you need to stop if you want the caffeine to work while you ride; f course if you drink coffee for some medical reason you need to continue that of course. An easy way to tell if you drink too much coffee is to stop drinking it for a day and see what happens, if you get a headache and or feel foggy you're addicted to the caffeine and the caffeine will have no effect on your riding.
If you're not a competitive cyclist you don't need to spend a bunch of money on various witches brews sold by bike shops, all you need is a little caffeine to sustain you on a long ride, and some chocolate milk for recovery. I do use one bottle of Cytomax mix for on the bike hydration, but I weaken it about 50%, and I have one bottle of clear water; I use to use Gatorade even when I use to race but over the years Gatorade has put in more sugar to where now it's got too much sugar and isn't good for cycling sports.