Output cache in MVC

你。 提交于 2019-12-11 03:08:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!