1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Rep Power

    Lightbulb 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.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Rep Power
    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.

IMN logo majestic logo threadwatch logo seochat tools logo