我试图做到这一点,它会导致产生与contentlen 0

它看起来像:

[OutputCache(Duration = 36000)]
public JsonResult GetFileClasses() 
{
   return this.Json(TopicConfig.FileExtensionsSettings.List)
}

任何想法?

有帮助吗?

解决方案

OutputCacheAttribute还必须指定,VaryByParam参数。否则,你会得到结果处理System.Web.HttpException: The directive or the configuration settings profile must specify the 'varyByParam' attribute.此异常 你可以尝试添加该参数,看看它是否工作。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top