I am building MVC application and would like to put caching in my application. I have read about caching that you need to just put [OutputCache(Duration=60, VaryByParam="none")] above controller method and it will work. However in my case i would like to cache not for whole controller methods but inner methods which would call from index controller and which will return IEnumerable<SelectListItem> and that result i want to cache.
But caching is only work for controller methods which will result view result, i have also searched for caching for non view methods and found some MVCDonutCaching and read this articles and by installing tried this also as per below
[DonutOutputCache(Duration=60, VaryByParam="none")]
public IEnumerable<SelectListItem> GetRegionList()
{
Region region = new Region();
return region.GetRegionsList();
}
But not luck to achieve my goal! have anyone done this type of caching here? then please help me to achieve this things.
Thanks in Advance.