Is it possible to use OutputCache on mvc JsonResult controller methods?
I am trying to do this, and it leads to result with contentlen 0
It looks like:
[Out开发者_JS百科putCache(Duration = 36000)]
public JsonResult GetFileClasses()
{
return this.Json(TopicConfig.FileExtensionsSettings.List)
}
Any ideas?
In OutputCacheAttribute
you must also specify , VaryByParam
parameter. Otherwise you'll get this exception on result processing System.Web.HttpException: The directive or the configuration settings profile must specify the 'varyByParam' attribute.
You can try to add this parameter and see if it works.
精彩评论