【问题标题】:CORS headers not being refreshed due to OutputCache in MVC 4 using the Thinktecture IdentityModel package由于 MVC 4 中的 OutputCache 使用 Thinktecture IdentityModel 包,CORS 标头未刷新
【发布时间】:2014-01-31 08:18:58
【问题描述】:

目前,我正在使用 Thinktecture 包为我的 MVC 4 应用程序提供 CORS 支持。在为方法添加输出缓存属性时,CORS 支持将丢失,因为 HTTP 标头可能已被缓存并且 ORIGIN 未修改 w.r.t。请求。我知道我可以使用内存缓存,但它更乏味。

【问题讨论】:

    标签: asp.net-mvc-4 cors outputcache thinktecture-ident-model


    【解决方案1】:

    使用 VaryByHeader

    [OutputCache(Duration = int.MaxValue, VaryByHeader = "origin;host")]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-23
      • 2014-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-07
      相关资源
      最近更新 更多