One knee or both? Is it just the L knee that has the 2-piece kneecap?
Do you always ride seated or do you stand to climb?
How long is a "long ride" (time).
My bad knee (old trauma/surgery) swells when there are climate changes such as approaching weather fronts or even walking from my climate-controlled office to outdoors. An hour of walking makes it ache too.
I never do full squats, orthopedist and physical therapist said just quarter squats. No full weight-bearing activities are allowed for aerobic exercise.
On the bike, I slide back on the saddle and drop my heels if I need to grind low cadence < 55 for hills/headwinds. It is easy on the kneecaps but tires calf muscles.
Spinning is hard to do with a stiff/swollen knee and limited range of motion. Some days I need a long warmup to be able to turn the cranks without pain on the bad knee. My avg cadence is < 70 , can't even turn 90+. Not a spinner.
Maybe a long warmdown & post-ride icing will help. Do you take any kind of anti-inflammatory OTC meds?