开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜