This one does go back a ways...
As someone with a bad case of motocrosser knees (...and ankles, and wrists, and frontal lobe, and shoulders, definitely the shoulders, and back, and...) I've found the easiest thing to do is to move around on the bike a bunch, and ride with people who can't go as long as you, like chain smokers or something, so you take more frequent breaks than you ordinarily would to walk around and stretch. You could probably find some sliders or some rearsets, and it might help but the cheapest and probably smartest thing is to just get off the bike more. And take lots of Advil.