This is about asp.net mvc3 web application.
We have used Object cache to store serialized objects(containing product details) to prevent expensive db queries.
Suppose it is storing 100 product properties in object cache which is retrieved at the time of loading page from cache and not from db. And then, it is passed to view which prepared and display page. So it iterates 100 time on view and call all other related partial view to prepare page.
Do you suggest storing generated view in cache rather then using object cache? And how to do it?
You can store the view in cache, if it’s static. You can do it by putting
OutputCacheattribute over action.VB:
C#
You can change VaryByParam setting if you want the cache to differ based on the action parameters