title: Controlling browser caching with ASP.NET and IIS 7.5
body: <p><a href="http://pagespeed.googlelabs.com" rel="nofollow">Google PageSpeed</a> suggests the following this for my website as a high priority.</p>
  
  <blockquote>
    <p>The following cacheable resources have a short freshness lifetime.
    Specify an expiry of at least one week in the future for the following
    resources:</p>
  </blockquote>
  
  <p>And suggests <a href="http://code.google.com/speed/page-speed/docs/caching.html#LeverageBrowserCaching" rel="nofollow">further reading</a>.</p>
  
  <p>I am using Windows Server 2008 r2, .net framework 4.0, asp.net and IIS 7.5. How can I increase the cache expiry for some files?</p>
  
  <p>I've tried the following web.config, but it doesn't work.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
      &lt;system.web&gt;
          &lt;sessionState mode="Off" /&gt;
      &lt;/system.web&gt;
      &lt;system.webServer&gt;
          &lt;staticContent&gt;
            &lt;clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="10.00:00:00" /&gt;
          &lt;/staticContent&gt;
      &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>