问题
How can I get the dropbox items in cache, in MVC?
I have tried the following, but it calls the page function each time.
What could be the issue or the right way to do it?
Please suggest.
[OutputCache(Duration = 10, Location = System.Web.UI.OutputCacheLocation.Server,
NoStore = true, Order = 0)]
public IEnumerable<SelectListItem> GetRegions()
{
回答1:
You should have it in your controller on those actions there
来源:https://stackoverflow.com/questions/9784914/output-cache-in-mvc