Eating before a workout - Optimal Time

I find 2-3 hours is a safe bet, but depends on food. In fact if I start feeling hungry, I take it as a good sign. For me it seems that the fattier the food, longer it takes and more it effects how I feel on the bike. Some oats porridge half an hour before works for me. But take salami or cheese and it will sit there for a good while.