title: How to configure static content cache per folder and extension in IIS7?
body: <p>I would like to set up rules in IIS7 for static content caching in my ASP.NET website.</p>
  
  <p>I have seen these articles, which details how to do it using the <code>&lt;clientCache /&gt;</code> element in <code>web.config</code>:</p>
  
  <blockquote>
    <p><a href="http://www.iis.net/ConfigReference/system.webServer/staticContent/clientCache" rel="noreferrer">Client Cache <code>&lt;clientCache&gt;</code> (IIS.NET)</a><br>
    <a href="https://stackoverflow.com/questions/865252/add-expires-or-cache-control-header-to-static-content-in-iis">Add Expires or Cache Control Header to static content in IIS (Stack Overflow)</a></p>
  </blockquote>
  
  <p>However, this setting appears to apply globally to all static content. Is there a way to do this just for certain directories or extensions?</p>
  
  <p>For example, I may have two directories which need separate cache settings:</p>
  
  <blockquote>
    <p><code>/static/images</code><br>
    <code>/content/pdfs</code></p>
  </blockquote>
  
  <p>Is it possible to set up rules for sending cache headers (<code>max-age</code>, <code>expires</code>, etc) based on extensions and folder paths?</p>
  
  <p>Please note, I must be able to do this via <code>web.config</code> because I don't have access to the IIS console.</p>