title: ASP.NET MVC: OutputCache and http headers
body: <p>I have just started using OutputCache on some of my controller actions and I am not quite getting the response I would expect.</p>
  
  <p>I have set the cache time to 5 minutes and the Expires header is coming up the same as the Last-Modified header which is the time that the request was made.</p>
  
  <p>This is the header I am currently getting:</p>
  
  <pre><code>Date                    Thu, 16 Jul 2009 06:35:07 GMT
  Server                  Microsoft-IIS/6.0
  X-Powered-By            ASP.NET
  X-AspNet-Version        2.0.50727
  X-AspNetMvc-Version     1.0
  Content-Encoding        gzip
  Cache-Control           public, max-age=300
  Expires                 Thu, 16 Jul 2009 06:35:06 GMT
  Last-Modified           Thu, 16 Jul 2009 06:35:03 GMT
  Vary                    *
  Content-Type            text/html; charset=utf-8
  Content-Length          575
  </code></pre>
  
  <p>This is the header I would expect:</p>
  
  <pre><code>Date                    Thu, 16 Jul 2009 06:35:07 GMT
  Server                  Microsoft-IIS/6.0
  X-Powered-By            ASP.NET
  X-AspNet-Version        2.0.50727
  X-AspNetMvc-Version     1.0
  Content-Encoding        gzip
  Cache-Control           public, max-age=300
  Expires                 Thu, 16 Jul 2009 06:40:06 GMT
  Last-Modified           Thu, 16 Jul 2009 06:35:03 GMT
  Vary                    *
  Content-Type            text/html; charset=utf-8
  Content-Length          575
  </code></pre>
  
  <p>Any ideas on why it would be doing this?</p>
  
  <p>Cheers
  Anthony</p>