loki
loki

Reputation: 2966

how to detect sql data changes to refresh cache data?

how to detect sql data changes to refresh cache data?i have cache algorith . i know caching . But i want to need some special usage to detect any changes in sql. How to make it below?BUT I NEED some advice and performance

enter image description here

Upvotes: 0

Views: 2728

Answers (1)

Pleun
Pleun

Reputation: 8920

You can use the the SqlCacheDependency Class.

ASP.NET allows you to use the SqlCacheDependency class to create a cache item dependency on a table or row in a database. When a change occurs in the table or in a specific row, the item that has a dependency is invalidated and removed from the cache. http://msdn.microsoft.com/en-us/library/ms178604.aspx

Upvotes: 2

Related Questions