MVC3 OutputCache VaryByHeader = Cookie not set

I have the following action method:

[HttpGet, Authorize, OutputCache(Duration = 60, VaryByHeader = "Cookie", Location = OutputCacheLocation.Any)]
public ActionResult Index()

But when I make a request, these are the headers issued:

Cache-Control: private, max-age=60, s-maxage=0
Content-Type: text/html; charset=utf-8
Content-Encoding: gzip
Expires: Fri, 22 Jun 2012 09:56:32 GMT
Last-Modified: Fri, 22 Jun 2012 09:55:32 GMT
Vary: Accept-Encoding

Why doesn't it include the cookie header in Vary?

I tried many settings options OutputCache, but to no avail :(

+5
source share
2 answers

Thus, the answer is included in the “page file name” associated with Andrew Bullock url, since “iis compression overwrites the variable header”.

2013 . ( Andrew Bullock). , , .

" " , ( , ), :

IIS Vary. , -, IIS 5 8 ( msdn msdn kb). IIS, , http://support.microsoft.com/kb/2877816/en-us, . ( ​​ Windows 8.1/2012 R2. IIS 7, win7 sp1, .)

: asp.net Vary ( ) outputCache location, Client. Downstream "" . , , Cache-Control private public. ( , .)

0

All Articles