【发布时间】: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
目前,我正在使用 Thinktecture 包为我的 MVC 4 应用程序提供 CORS 支持。在为方法添加输出缓存属性时,CORS 支持将丢失,因为 HTTP 标头可能已被缓存并且 ORIGIN 未修改 w.r.t。请求。我知道我可以使用内存缓存,但它更乏味。
【问题讨论】:
标签: asp.net-mvc-4 cors outputcache thinktecture-ident-model
使用 VaryByHeader
[OutputCache(Duration = int.MaxValue, VaryByHeader = "origin;host")]
【讨论】: