@chansmann Sorry for the late response, I only now see you asked the follow-up question.
Basically, caching here means retrieving the related objects and storing them in a variable that you can access directly in the sort function so that you don’t need to make a DB call in order to get their values.
Look at this answer for an example.
I hope this helps