title: IIS 8.5 MVC5 Client Cache is ignored
body: <p><strong>TL;DR - I want the server (IIS 8.5) to return 304 not modified for the CSS and JS bundles.</strong></p>
  
  <p>I've been unable to get IIS 8.5 to honor the clientCache settings in web.config.  No matter what I do, I can't seem to get it to cache the static content.  This is a MVC5 app in VS2013.  I've got all the static files in a folder "Assets".  </p>
  
  <p>The request looks like:
  <a href="http://someserver/AppName/Assets/mainjs?v=FNj_9ZPAbYVAQsyDo2F8XUnWv5NQpY4iX2RGu4NpJ5g1" rel="nofollow">http://someserver/AppName/Assets/mainjs?v=FNj_9ZPAbYVAQsyDo2F8XUnWv5NQpY4iX2RGu4NpJ5g1</a></p>
  
  <ol>
  <li>Attempt #1, place a new web.config in the Assets folder with the following:</li>
  </ol>
  
  <blockquote>
  <pre><code>&lt;configuration&gt;
    &lt;system.webServer&gt;
      &lt;staticContent&gt;
        &lt;clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" /&gt;
      &lt;/staticContent&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  </blockquote>
  
  <ol start="2">
  <li>Attempt #2: place this following configuration in the root web.config</li>
  </ol>
  
  <blockquote>
  <pre><code>&lt;staticContent&gt;   
      &lt;clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" /&gt;    
  &lt;/staticContent&gt;
  </code></pre>
  </blockquote>
  
  <ol start="3">
  <li>Attempt #3: trying setting the cache using the location tag</li>
  </ol>
  
  <blockquote>
  <pre><code>&lt;location path="Assets"&gt;
    &lt;system.webServer&gt;
      &lt;staticContent&gt;
        &lt;clientCache  cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" /&gt;
      &lt;/staticContent&gt;
    &lt;/system.webServer&gt;
  &lt;/location&gt;
  </code></pre>
  </blockquote>
  
  <p>Here are the things I've tried in IIS 8.5 manager.  Under the Default Web Site/TestApp</p>
  
  <ol>
  <li>HTTP Requeset Headers, Set Common HTTP Headers, check "Expire Web Content" "After 365 Day(s)".</li>
  <li>Apply the same setting to the "Assets" folder </li>
  </ol>
  
  <p>I've tried these steps each on their own and all together and every other which way.  No matter what, it won't add the <code>max-age</code> value to Cache-Control.</p>
  
  <p>For each of these, the browswer returns 200 responses for the CSS and JS bundles.  I cannot get the server cache the content coming from the Assets folder.  </p>
  
  <pre><code>Cache-Control:private
  Content-Encoding:gzip
  Content-Length:22591
  Content-Type:text/css; charset=utf-8
  Date:Mon, 02 Feb 2015 21:49:49 GMT
  Expires:Tue, 02 Feb 2016 21:49:49 GMT
  Last-Modified:Mon, 02 Feb 2015 21:49:49 GMT
  Persistent-Auth:true
  Server:Microsoft-IIS/8.5
  Vary:Accept-Encoding
  X-AspNet-Version:4.0.30319
  X-Powered-By:ASP.NET
  </code></pre>