Reputation: 2718
Our site has a large number of lists of constants for fields such as address type descriptions, states, generic comments, boolean type values, gender, etc...
We would like to be able to have this data available on all of our pages or at least the relevant lists given the page being loaded.
Our architecture consists of client side HTTP and Ajax requests hitting our MVC4 controller actions where those actions then query the Web API and retrieves data from the database etc.
We have decided to go with http://www.asp.net/web-forms/tutorials/data-access/caching-data/caching-data-at-application-startup-cs as well as some client side caching.
Is there anything else we can do so we can have these values on the client with even less overhead? Should we cache on controller methods (essentially caching what's inside HttpRuntime.Cache?
thanks
Upvotes: 3
Views: 591
Reputation: 4101
Both of the ideas that you have for caching are good ideas, lookup lists data that does not change often or can be predicted consistent list by user id for example are all candidates for caching
By client side caching, I can't tell if you are using output caching or something else but I would look at output caching where appropriate
[OutputCache(Duration = int.MaxValue, VaryByParam = "id")]
public ActionResult Details(int id)
Two small points about output caching
More information about output caching can be found here http://www.asp.net/mvc/tutorials/older-versions/controllers-and-routing/improving-performance-with-output-caching-cs
Upvotes: 3