I don't know about the headaches, but I would avoid drinks with all of that sugar and crap in them. For very hot weather, pre-hydrate a bit with water and up your salt intake a little, eat bananas.
For electrolytes, I prefer Nuun tablets, the kind that have no additives and are called Nuun Natural. They are pretty cheap. I only use Skratch Lab mix for my "sports drink." It's expensive, but no after taste, no bad crap in it, and it doesn't gunk up your bottles. Gatorade is poison. I used Accelerade for years, and it hurt my stomach.
For a 19 mile ride, you shouldn't need that much liquid. Yes, you need to drink more when it's hot, but be careful. I did a 35 mile ride in similar conditions on Wednesday and I had one bottle of Skratch mix and one of water, along with a couple of Shot Blocks. I would keep my hydration and nutrition to things that are as natural as possible. I remember someone posting a recipe for a home made drink mix, you might want to search for.
2015 Trek Silque SSL
Specialized Oura
2011 Guru Praemio
Specialized Oura
2017 Specialized Ariel Sport