We have an MVC3 application in which we have created many small actions and views to handle data placement wherever we need. For example, if it was a blog, and we wanted to show comments, we have the action and presentation of comments, and we can post it wherever we want, view the user profile and view the blog post, etc.
The problem caused by this is that every small view or action needs to be made a call, usually to the same service, several times per page load due to all the other small views that we have in our application. Thus, on a very large page containing these small views, we could have 80 + sql calls, with 40% of them duplicated, and then the page slows down. Currently, the solution is to cache some data and transfer some data to the ViewBag, if we can, if you want, as a user profile, you check if it has its cache or ViewBag if it does not ask for it.
This is really really messy for the design, and the view mode approach seems awful as it needs to be passed down from top to bottom. We added some data to HttpCurrent.Items to do this per request (instead of caching, as this data may change), but should there be some clean solution that doesn't seem wrong and also clean?
EDIT
I was asked to clarify, and although this is an internal business application, I can’t give away most of the specifics.
, . facebook. , MVC facebook, , . , , ( , 4 ), , . , .., , , , , , .