There isn't a special 'race diet'. Before you race you'll probably be training - and the type of fuel that you use during a race is the same as you'd use during your training ride.
You need to start each race with good muscle glycogen stores and good fluid stores to prevent early fatigue through either lack of glycogen or lack of adequate hydration. During the faster phases of a race you will use a greater proportion of carbohydrate to fat, to provide energy quickly. During the slower phases, you will use a slightly higher proportion of fat, but you will still use a lot of carbohydrate over the time period.
Carbohydrate is the best energy provider as it is able to provide energy quickly to working muscles. Fat can only be used in combination with carbohydrate, even then it provides energy at a much slower rate.
Importance of hydration
Performance during a race can be dramatically affected by even slight dehydration. Before a race you can check if you are fully hydrated by looking at the colour of your urine: if it is pale or straw-coloured then you should be well-hydrated; if it is dark yellow then you are probably not adequately hydrated and you should take on board some extra fluid straight away. It is wise to be aware of your fluid intake for the few days before a race, rather than leaving it until the last minute. Sometimes you will not have enough time to drink the quantity of fluids you need to fully hydrate.
What and when to eat and drink
When you eat and drink can have an effect on performance. The morning of a race is too late to rehydrate or refuel substantially. Before a race, you would obviously not eat a large meal, but equally you need to ensure that you have not left it too long without consuming some carbohydrate.
The added advantage of liquid food is that consuming theses will also rehydrate you at the same time
A light, easily digested meal, such as sandwiches, toast, cereals, etc. 2-3 hours before your start time is ideal. In races lasting over an hour you will need to consume around 30-60g of carbohydrate per hour. You can get this from one or two cereal bars, or one or two large bananas.
The level of required carbohydrates can also be reached in liquid form alone, such as 500-1000ml of an isotonic sports drink every hour. The added advantage of liquid food is that consuming theses will also rehydrate you at the same time. For best recovery, you need to begin eating within the first 20-30 minutes of finishing your race.
Foods to avoid
On the day of a race do not try out any new foods, drinks or timings of meals. Training runs are the time to practice with these! See what works best for you and stick to it on the day. You might find that you are not able to digest foods as easily on the day of a race due to feelings of anxiety or the greater intensity of effort during racing compared to your usual training routines. In which case you may find it beneficial to stick with lower fibre, high carbohydrate, low fat foods. These are easier and quicker to digest, which will be more important to you than their vitamin and mineral contents.
it is best to avoid the caffeine and stick with plain water, fruit squash or an isotonic or energy drink, depending on the length of the ride.
Don't be tempted to have large quantities of a high energy carbohydrate drink in an attempt to stock up on carbohydrates in the hour leading up to the race. If you have eaten plenty of pasta, rice, bread etc. in the days beforehand you will have good muscle glycogen stores when you start the race. The morning of a race is too late to do this: the foods that you eat then will be mainly to avoid low blood glucose levels, not to refuel your muscles.
Drinks containing caffeine such as fizzy drinks, tea, coffee and hot chocolate, will make it more difficult for you to keep well hydrated. Any possible beneficial affects on performance could well be counteracted by the affects of dehydration if you do not drink additional fluids to compensate for the diuretic action of the caffeine. In most situations it is best to avoid the caffeine and stick with plain water, fruit squash or an isotonic or energy drink, depending on the length of the ride.