Here is my advice regarding how to keep your cache up to date. This advice is for a beginning strategy. As your application becomes more mature, we can discuss additional refinements and optimizations. Don't hesitate to call or email me if you have questions or concerns.
The basic strategy is to periodically refresh the cache by retrieving data from the database.
Simple Mechanism for Updating the Cache
We have periodically discussed using our Asynchronous Queries feature and a Push strategy, but I would start with something simpler. I would store a variable in session state for Last_Query_Time. At some predictable event (e.g., Page Refresh), I would compare the current time with Last_Query_Time. If the time interval were greater than some interval (e.g, 5 minutes). I would requery.
What should you Query for?
You could refetch/refresh the items currently in the cache, but that's not normally what you want. You want the recent inserts as well. What you really want to do is to make the same query (or set of queries) that you made at the beginning of your application to pick up any recent changes. For example, if you are viewing all posts made to your website since the beginning of the year, you want to requery to see all recent posts as well.
Sometimes, the requery will be easy to construct, but if you have made many different queries on the same or related tables, it may not be so easy. In some cases, if the table is fairly small, you can just requery for the entire table.
Ask only for Recent Data
One optimization that you can do is to ask for only the recent data. In other words, if you are querying for orders, you might only ask for any order or order change in the last five minutes. Be wary of querying for recent data from very large tables. Databases are usually not indexed on mod time stamp, and as a result, you could have poor performance. Try to restrict the amount of data you are requerying if you can.
Merge Strategy
You should use a MergeStrategy of OverwriteChanges