title: IIS Image Cache Directives Cause 500.19 Error
body: <p>I wanted to add cache header to browser on IIS. I found this:
  <a href="https://stackoverflow.com/questions/10653549/iis-7-5-and-images-not-being-cached">IIS 7.5 and images not being cached</a></p>
  
  <pre><code>&lt;staticContent&gt;
      &lt;clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00" /&gt;
  &lt;/staticContent&gt;
  &lt;httpProtocol&gt;
      &lt;customHeaders&gt;
          &lt;add name="Cache-Control" value="public" /&gt;
      &lt;/customHeaders&gt;
  &lt;/httpProtocol&gt;
  </code></pre>
  
  <p>This solves cache problem that Google warned about on PageSpeed test:
  <a href="https://developers.google.com/speed/pagespeed/insights/" rel="nofollow noreferrer">https://developers.google.com/speed/pagespeed/insights/</a></p>
  
  <p>But also this causes 500.19 error, and it says that: <strong>"The configuration section 'staticContent' cannot be read because it is missing a section declaration"</strong></p>
  
  <p>My web.config file was look like that:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
      &lt;appSettings/&gt;
      &lt;connectionStrings/&gt;
      &lt;system.web&gt;
          &lt;compilation debug="false"&gt;&lt;/compilation&gt;
          &lt;authentication mode="Windows"/&gt;
      &lt;/system.web&gt;
      &lt;system.webServer&gt;
          &lt;httpErrors errorMode="Custom"&gt;
              &lt;remove statusCode="404" subStatusCode="-1"/&gt;
              &lt;error statusCode="404" prefixLanguageFilePath="" path="/rewrite.asp" responseMode="ExecuteURL"/&gt;
          &lt;/httpErrors&gt;
      &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>How to prevent this error?</p>