I tend to get quad cramps after about 30-35 miles simply because of the hilliness of the area around me, generally when that happens I try to alternate stretching my legs on the downhills just by sitting on them as I ride.
Other than that, drink a lot of water (30-50 fl oz) leading up to the ride the day before and make sure to keep some light food as well as plenty of water on you during the ride.