2

I am looking for an efficient cache strategy for C#. I am constructing an MVC application however one of my queries targets a historical table with states, etc. Needless to say, the query is highly nested and complex, and I do not want to run it every time a person hits the site, so I decided to cache the data (either the results or the tables themselves). I dont want to store my cache in the Managed heap due to the stop-the-world garbage collection problem which is common with generational GC's and Caches. I was wondering, does the Cache Application Block (http://msdn.microsoft.com/en-us/library/ff650180.aspx) use Unmanaged memory (off the managed heap?). Is there a way to access memory directly via native IO? Any other cache tools worth looking into?

3 Answers 3

2

I highly suggest you look at AppFabric Caching. I just implemented for my MVC app and it worked great.

I used this blog to get started:

http://www.hanselman.com/blog/InstallingConfiguringAndUsingWindowsServerAppFabricAndTheVelocityMemoryCacheIn10Minutes.aspx

Let me know if you need some code samples.

Sign up to request clarification or add additional context in comments.

Comments

2

.Net caching frameworks that I am aware of:

Although I've looked into various caching frameworks I'm afraid I don't have very much experience with any of them except for System.Web.Caching - this works fine for our purposes.

Comments

2

You can as well explore the distributed caching options like Memcached or SharedCache. We had used SharedCache for one of our project and it worked well. As suggested in one of the answers you could also try AppFabric. If you are looking at Microsoft based solution then there is a distributed caching famework by Microsoft called Velocity.

Hope this helps.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.