title: OutputCache.VaryByHeader is not generating a Vary header in the response
body: <p>I have this action method:</p>
  
  <pre><code>    [OutputCache(Duration = 2, 
                   Location = OutputCacheLocation.Any, 
                   VaryByHeader = "Accept-Charset")]
      public ActionResult Index()
      {
          return View();
      }
  </code></pre>
  
  <p>And the generated response is:</p>
  
  <pre><code>Cache-Control:public, max-age=2
  Content-Length:5164
  Content-Type:text/html; charset=utf-8
  Date:Wed, 28 Sep 2011 16:30:33 GMT
  Expires:Wed, 28 Sep 2011 16:30:35 GMT
  Last-Modified:Wed, 28 Sep 2011 16:30:33 GMT
  Server:Microsoft-IIS/7.5
  Vary:*
  X-AspNet-Version:4.0.30319
  X-AspNetMvc-Version:3.0
  X-Powered-By:ASP.NET
  </code></pre>
  
  <p>Why is the <code>Vary</code> header showing an asterisk instead of <code>Accept-Charset</code> ?</p>
  
  <p><code>OutputCacheAttribute</code> does have effect on the response, actually, the <code>Expires</code> and <code>Cache-Control:max-age=n</code> headers depends on the <code>Duration</code> argument, and the <code>Cache-Control:public</code>/<code>private</code>/<code>no-cache</code> depends on the <code>Location</code> argument.</p>
  
  <p>I have created a wrapper for <code>OutputCacheAttribute</code> to see what is going on:</p>
  
  <pre><code>public class CustomOutputCacheAttribute:OutputCacheAttribute
  {
      public override void OnResultExecuted(ResultExecutedContext filterContext)
      {
          base.OnResultExecuted(filterContext);
  
          Dictionary&lt;String, String&gt; headers = new Dictionary&lt;string, string&gt;();
          foreach (var header in filterContext.HttpContext.Response.Headers.AllKeys)
              headers.Add(header, filterContext.HttpContext.Response.Headers[header]);
  
          Debugger.Break();
      }
  } 
  </code></pre>
  
  <p>The headers are not shown in the break, so probably what <code>OutputCacheAttribute</code> does is configure <code>HttpContext.Current.Response.Cache</code>.</p>
  
  <p>I can see how <code>filterContext.HttpContext.Response.Cache.VaryByHeaders.UserCharSet</code> is <strong>true</strong>, and for example <code>filterContext.HttpContext.Response.Cache.VaryByHeaders.AcceptTypes</code> is <strong>false</strong>, but the <code>Vary</code> header always says <strong>*</strong>.</p>
  
  <p>I am wondering if the only possible values are the four ones listed as properties of <code>filterContext.HttpContext.Response.Cache.VaryByHeaders</code>, could it be?</p>
  
  <p>Cheers.</p>