April 22nd, 2012, 03:06 AM
ASP.Net Caching & PostgreSQL
Caching information in ASP.Net is very easy and works great. However, one particularly good feature, is the ability to use SQLCacheDependency.
For those of you that don't know what that it, is basically allows me to wire up a broker to the MSSQL server and watch a particular table. So, if nothing has changed in that table then a cache result can be served to the client. As soon as the table changes the broker notifies my ASP.Net application so that it knows the next request should contain fresh data. Neat huh!
Unfortunately it seems that ASP.Net can only use MSSQL for this particular feature. My question is, is there a way to use this feature with PostgreSQL or at least provide a similar methodology to get a similar feature set/result?
Much appreciation to those who take the time on this one in advance.
April 22nd, 2012, 03:15 AM
I know nothing about .Net or that broker.
But if can hook into the way SQLCacheDependency works, you might be able to write your own "listener" using PostgreSQL's "notify" and "listen" feature:
You would need to write a trigger for each table you want to watch. That trigger would then send a NOTIFY message which your daemon can receive and e.g. invalidate the cache.