Last post Aug 12, 2011 05:07 AM by sirdneo
Aug 08, 2011 11:46 AM|nirman.doshi|LINK
I am writing an ASP.NET MVC application, and I would like to implement database caching. My objective is detailed as below -
- There is one stored procedure which retrieves data from database, and presents them to the screen.
- The resultset is presented as a multi-columner list in my page, and it has Edit button.
- Now when user clicks on "Edit" button, I would like my application to get that row from database only if at least one of the column been changed, otherwise, I want the cached data to be used that will be presented in Edit form. Because I want minimum round-trips
and database operations.
What is the best way to achieve this?
Do let me know if anything above does not make sense.
Any suggestions, Much Appreciated
Aug 09, 2011 06:11 AM|Dave Sussman|LINK
One way to do this would be to use the Cache object and a SqlCacheDependency, which ensures that the data is evicted from the cache if it has changed in the database. Have a search for "asp.net data caching sqldependency" and you'll get a ton of articles
that should help.
Aug 12, 2011 05:07 AM|sirdneo|LINK
You can use Cache Dependency to resolve your problem, for details see:-