We have a situation, where we feel we do not fully take advantage of NHibernate's capabilities, which reduces performance. The actual situation is reduced to a "blogs with posts" example for this question.
A blog site, where each user can have its own blog which has an arbitrary number of posts. Therefore, there is a table for posts defined with the following columns:
id, blog_id, post_title, post_contents
Most blogs are rarely updated, while a few are "twitter-like" with frequent updates. There are many more reads than writes.
The front page of each blog displays the latest 5 entries.
SELECT TOP 5 * FROM blog_posts WHERE blog_id = ?
This will result in a number of elements being placed in both the 2nd level cache and query cache.
Our problem is, that the cached query results for the blogs with 99%+ reads are destroyed because of the few blogs being updated frequently.
How do you others usually solve this issue? What are the best practices?