I have a website that allows searches for lists of content in various ways, for instance "show stuff created by user 523 ordered by date" or "show a list of the most recent 10 posts."
I use Hibernate for my ORM, and Hibernate provides a cache for objects. For lists of objects, though, like the front page list of most recent content, I'm at a loss as how best to cache that content. Right now, I have my Spring controllers just return a standard JSP page, and then I use oscache at the JSP level wrapped around a call to another class.
This seems inelegant, though. What I really want is for my controller to have access to a cached result if one's available so that the JSP can just be concerned with displaying results.
What are my options here?