You don’t need special sports drinks or power bars. Even the most elite athletes can get the nutrients they need from ordinary foods, water and salt. Healthy and fit people usually don’t need to eat during a bicycle ride when they cycle at a casual pace for less than two hours. However, you can prolong your endurance for a hard ride by taking:
• a source of sugar when you ride very hard for more than an hour
• a source of salt when you ride for more than three hours.
Your muscles use primarily sugar and fat for energy. You have an almost infinite amount of fat stored in your body, but you start to run out of sugar stored in your liver after 70 minutes of intense exercise.  There is only enough sugar in your bloodstream to last three minutes at rest. To maintain blood sugar levels, your liver constantly releases sugar into your bloodstream.  However, there is only enough sugar stored in your liver to last about twelve hours at rest and less than 70 minutes when you exercise intensely. Your brain has almost no stored energy, so it gets almost all of its energy from the sugar carried to it in your bloodstream. When liver sugar levels drop, your blood sugar levels also drop and your brain has lost its main source of energy. Your brain then cannot function normally and you feel weak, tired, confused, and can even pass out.  It should never happen to you.
An hour or more before your ride, eat oatmeal or whatever you normally eat for breakfast.  Avoid high-sugar-added foods such as pancakes with syrup, because they can cause a high rise in blood sugar, followed by a high rise in insulin, followed by a drop in blood sugar that will make you feel tired.  The extra sugar you ate just gets stored as fat and does nothing to help you during your ride.
Sugar Before and During a Long, Hard Ride
Take sugar no more than five minutes before you start your ride, or wait until you are underway. Do not take sugar earlier than that because when you eat sugar and your muscles are not contracting, you can get a high rise in blood sugar that causes the pancreas to release large amounts of insulin. This can cause a drop in blood sugar levels that can tire you. On the other hand, exercising muscles draw sugar rapidly from the bloodstream without needing insulin, so taking sugar during exercise or just before you start usually does not cause the high rise in blood sugar levels.
The rule of thumb is that you should take a source of sugar during a hard ride lasting more than an hour.  Use a sugared drink, jelly beans, gel packets or any other convenient source.  You don’t need special sports drinks or energy bars because no sugar source is better for you than one that contains glucose and fructose, and almost all types of sweet foods contain these two sugars.
During a hard ride, take sugar before you feel hungry. Hunger during exercise is a very late sign of not getting enough calories. By the time you feel hungry, your body will be so depleted of sugar that you will have to stop or slow down so you can eat some carbohydrate-rich food just to restore your sugar supplies.
Sugar with Caffeine
Taking caffeine with sugar during hard rides can increase endurance and improve your performance.  Caffeine works by increasing the absorption of sugar from your intestines and by increasing your exercising muscles’ uptake of sugar. However, taking sugar and caffeine when you are not exercising doubles your rise in blood sugar, and high rises in blood sugar can increase your risk for weight gain, diabetes and heart attacks.
The only mineral that you may need to take during a long ride is sodium, found in regular table salt. Just about everyone agrees that you need to take in extra salt during extended athletic competitions in hot weather, but you do not need to take extra potassium, magnesium or any other mineral during exercise. Salt is necessary to hold water in your body, prevent muscle cramps, and help keep your muscles contracting with great force. However, excess intake of salt may raise blood pressure and increase risk for heart attacks, particularly in people who have big bellies and high blood sugar levels.
If you do not meet your needs for salt during a long ride in hot weather, you will tire earlier and increase your risk for heat stroke, dehydration and cramps. During a hard ride lasting longer than three hours, eat salty foods such as salted nuts or potato chips. Some sports drinks contain salt, but since salted drinks taste awful, the amount added is so small that it may not be enough to meet your needs.
Eat Within an Hour After a Hard Ride 
Eating within an hour after finishing a ride helps muscles heal faster and also replenishes their stored sugar faster than if you eat later. Your muscles are far more sensitive to insulin immediately after exercising, and insulin hastens muscle healing. Within one hour after your hard ride, eat fruits, vegetables and grains (for carbohydrates) and nuts, beans or seafood (for protein), or whatever else you like.  Add salt if you have been sweating a lot, if your muscles feel excessively fatigued or you develop muscle cramps. As long as the post-ride meal contains protein and carbohydrates, it doesn’t matter what you eat.
• If you are planning to ride vigorously for more than an hour, take a source of sugar, such as jelly beans or any sugared drink, a few minutes before you start and every hour or so during your ride. There is no significant advantage to special sports drinks.
• If you are riding hard for more than two hours, take some food that includes sugar such as fruit, cookies or candy bars.
• If you are going to ride hard for more than three hours, or in very hot weather, add salty foods such as salted nuts or potato chips.
• Eat to recover – any foods containing protein and carbohydrates — within an hour after you finish your ride, or as soon as you can.  See Recovery: the Key to Improvement in Your Sport
Checked 3/10/23