hari_sree
hari_sree

Reputation: 1538

Caching usable in both WCF and ASP .NET applications (.NET 3.5)

I need caching facility which should work from both WCF and from within an ASP .NET app. I have seen:

  1. System.Web.Caching.Cache which is not usable from WCF (as I understand it is usable only if service is hosted in IIS, which is not always the case)

  2. System.Runtime.Caching which is usable from both of them, but only available from .NET 4, but our .NET version is 3.5.

Any suggestions?

Upvotes: 3

Views: 1303

Answers (2)

Carson63000
Carson63000

Reputation: 4232

You can absolutely use System.Web.Caching.Cache outside of IIS. Just add a reference to System.Web and away you go - it is absolutely not a feature of IIS.

There were issues in .NET 1.0 and 1.1 but apparently not in 2.0 and upwards - see this Knowledge Base article.

But like Davide Piras I would also recommend considering AppFabric to share the cache between your two applications, if that would be useful. I'm not sure what you mean by "my requirement cannot afford something like AppFabric" - by "afford" are you talking about performance, memory, or what? Whilst AppFabric is designed to be used on a cache server it does not by any means require dedicated hardware, you can run the service on the same box as your application if you need to.

Upvotes: 3

Related Questions