In ASP.Net web farm is database dependent Caching a good approach?

694 views Asked by At

I was looking at using data caching with database dependency for a web farmed ASP.Net app. So each web server in the web farm would automatically refresh its Cache value as soon as the database value changes. This would appear to keep all Cache values across the web servers synchronized. Does this sound like a good idea or I am missing something?

1

There are 1 answers

3
deostroll On BEST ANSWER

No. It does not mean all servers will refresh once the value in the db refreshes, unless you use something like SqlCacheDependency. Take a look @ the following link for that: http://www.asp.net/web-forms/tutorials/data-access/caching-data/using-sql-cache-dependencies-vb

Otherwise the mechanism simply involves looking into the database and taking the value from there. There might be sql jobs which might refresh the value. Hence it is different from above.

Note: for SqlCacheDependency you need to use MSsql 2005+ server.

The other tecnique would be to employ the use of web hooks in your solution...