Reputation: 1538
I need caching facility which should work from both WCF and from within an ASP .NET app. I have seen:
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)
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
Reputation: 704
new solution use Windows Server AppFabric Caching
https://github.com/geersch/AppFabric
http://dotnet.dzone.com/articles/caching-wcf-services-part-2
http://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/AAP314
***2.in .NET 1.0 and 1.1 http://support.microsoft.com/kb/917411
Upvotes: 1
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