none
WCF NetTCP Binding & SQLCacheDependnacy RRS feed

  • Question

  • Is it possible to configure WCF with tcp binding and SQL Cache Dependancy using IIS?

    Can anyone kindly point me to some resources?

    I only can find if you run your WCF over HTTP.

    TIA.

    Saturday, August 24, 2013 7:40 AM

Answers

  • Hi Silver09,

    The outputCache (like what can be used on ASP.NE web page or WCF REST service opreration via AspNetCache attribute) cannot be used on netTcpBinding based service. I'm wondering how you will want to apply the Sql Cache Dependency in your WCF netTcpBinding service. If your service have some large data which will query/retrieve from a backend service/database and you want to use cache to reduce the backend data query/polling time, I think you can try use code to programmatically store the data objects (retrieved from database) into the Cache storage and apply Sql dependency on the inserted cache entry:

    #Caching in ASP.NET with the SqlCacheDependency Class
    http://msdn.microsoft.com/en-us/library/ms178604(v=vs.100).aspx

    #SqlCacheDependency Class
    http://msdn.microsoft.com/en-us/library/system.web.caching.sqlcachedependency.aspx

    BTW, since .NET 4.0, there comes a new System.Runtime.Caching namespace which provides the ASP.NET like in-memory caching feature for all standard .NET applications. And the memory caching also include sql database based change monitoring/notification support. You can also take a look on that:

    #Using MemoryCache in .NET 4.0
    http://www.codeproject.com/Articles/290935/Using-MemoryCache-in-Net-4-0

    #.NET 4.0 MemoryCache with SqlChangeMonitor
    http://www.codeproject.com/Articles/167282/NET-4-0-MemoryCache-with-SqlChangeMonitor


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, August 26, 2013 3:47 AM
    Moderator