We have an ASP.NET web application in which we would like to provide a list of 10 recently accessed items by that user when that user is logged in.
As far as the table design, I created the following schema to store who accessed what entity at what time.
[RecentItemsGUID] [uniqueidentifier] NOT NULL,
[PersonGUID] [uniqueidentifier] NOT NULL,
[EntityTypeID] [tinyint] NOT NULL,
[EntityGUID] [uniqueidentifier] NOT NULL,
[AccessDate] [datetime] NOT NULL,
I can add a control on the master page that will show the recently accessed item. But, instead of loading this information on every page load from the database, I would like to cache this information for each user. I looked at the OutputCache directive and placing this information in a UserControl, then I can use the varybycustom attribute. But when the user goes to another page and accesses another entity, how should I mark this cache dirty so that next time the usercontrol is loaded, it makes a DB call and retrieves the new items. I cannot really use the SystemUserGUID stored in the cookie for the varybycustom parameter because I want the list to update every time the user interacts with a new entity.
If anyone can provide some suggestions on how to accomplish this in the most efficient manner, that will be great.