Yeah, don't "push through the pain" with knee twinges. That never works on joints.
And change positions often. With marathon indoor trainer sessions I get off the bike about once an hour, usually between episodes of whatever TV series I'm binging. Same outdoors. If I feel even a twinge in the knee I'll stop for a few moments, stretch and walk around, maybe adjust the saddle/seat post. I'll ignore most muscle discomfort, but not knees or other joints.