What are some good exercises to prevent knee pain? About four or so years ago, I hurt my knee on a fairly long ride (~150km or so).  It was really my own fault, as I hadn't been training regularly, and I pushed myself a bit too hard.  By the time I arrived home, my left knee had swollen up and was in quite a bit of pain.  I stopped riding for about a half year, and when I started up again I took things lightly and tried to train more regularly.

Fast-forward to today.  I am riding 20km per day, and am spinning at high cadence when I ride.  I try to stretch both my knees before/after riding, but I still feel some soreness or pain when I ride.  Although I haven't yet experienced anything as bad as the original injury, I'm worried that if I will get injured on the next long-distance ride that I take.

What are some good exercises that I can do to prevent re-injuring my knees during future rides?  Are there any particular stretches which are helpful in loosening up the knee before riding?
The problem with diagnosing knee pain is there are multiple possible causes. The original cause may not even be in the knee itself! I have a cyclist friend whose knee seized up. He went to a physiotherapist, who explained that the real problem was an extremely tight lower back. The tightening back was tugging at his gluteal muscle (buttock), which in turn was tightening his hamstring - which was pulling his knee out of alignment! His body was actually acting against itself, as each muscle struggled to retain its preferred position. The physio pummelled out his back and glutes, he did back stretches for a few weeks, and everything relaxed.

I've had ITBS for almost a year, caused by a combination of incorrect seat height and an over-aggressive cycling schedule. The iliotibial band is a tendon-like bit of muscle which runs down the outside of the thigh and connects the hip and knee. When it tightens, it pulls at your knee-joint and rubs painfully against the bone, becoming inflamed.

For this problem, stretching has been surprisingly effective. I stretch the IT band itself, my hamstrings, and my lower back and glutes. The stretches I do are:

IT band - Standing stretch. Stand upright and cross one foot behind the other. Then lean towards the foot that is behind the other. Hold this stretch for about 15 to 20 seconds, and then repeat it 3 to 4 times on each leg.

Hamstring - Standing stretch. Basically, try and touch your toes, although I do this with legs crossed one behind the other. With this one, if you let your upper body just hang loose, you will feel the stretch increase naturally after a few seconds.

Glutes/lower back - Seated twist. This is an effective stretch for the big muscles in your buttocks.

Glutes/lower back - Supine spinal twist. Great for the lower back, and your hips.

Obviously, these exercises may or may not be helpful for you, depending on the exact cause of your problem. Only a doctor will be able to correctly diagnose your issue. But they're easy to do, safe, free, and may be helpful.