When I use
Response.Cache.SetCacheability(HttpCacheability.Private)
and Response.Cache.VaryByHeaders["someValue"] = true;
the Vary
header is missing from the response!
There is NO problem with the Response.Cache.SetCacheability(HttpCacheability.Public)
and Response.Cache.VaryByHeaders["someValue"] = true;
although. It Returns Vary: someValue
The same problem when using web.config and controller attributes
add name="myCacheProfile" enabled="true" duration="3600" varyByParam="*" varyByHeader="someValue" location="Downstream" Works and sends the Vary header
add name="myCacheProfile" enabled="true" duration="3600" varyByParam="*" varyByHeader="someValue" location="Client" doesnt work!