I am fairly new at using the ASP.NET MVC framework and was hoping that I could find some help about best-practises when caching various parts of my MVC web application. I know that stack overflow uses MVC and some pretty freeking awesome caching techniques, and its MILES faster than my app, even when running locally.
I have a few questions.
-
How does the caching actually work, and how do you ‘enable’ it, and what are the various options. What is the best kind of caching to use?
-
My app has a lot of database transactions, lists that regularly change. I am worried about the timliness of page refreshes, in users not getting the most recent version of the data. Whats the best way to strike a balance between web application speed and displaying ‘up-to-date’ data? What best practises have you guys found when having to deal with this issue?
-
How do I cache different parts (I assume views) with different caching settings? I assume that it could be done with sub-controllers, but I have NFI how to go about doing this.
-
I am using the Castle.Windor integration to the controllers, I am not sure if this changes anything.
-
Any other best practises of notes of things to be wary/careful of would be greatly appreciated.
You might want to take a look at Phil Haack post for some donut caching. He’s THE reference for ASP.NET MVC 🙂