title: Set a header by Content-Type
body: <p>I have used this before;</p>
  
  <pre><code>&lt;IfModule mod_expires.c&gt;
    ExpiresActive On
    ExpiresByType image/gif "now plus 2 weeks"
    // Lots omitted here
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>And this;</p>
  
  <pre><code>&lt;IfModule mod_headers.c&gt;
    &lt;filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|JPG)$"&gt;
      Header set Cache-Control "max-age=1209600"
    &lt;/filesMatch&gt;
    // Lots omitted here
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I can set the expires on by content-type and I can set any header I wish by file extension.</p>
  
  <p>But neither of these seem to let you set any header you want by content-type.</p>
  
  <p>I want to set the cache-control header based on the content-type of the response - note that this is not the same as the file extension. I have "friendly URLs" so there is no file extension to be captured by <code>filesMatch</code> so there is no file extension but the content-type is <code>text/html</code>.</p>
  
  <p>How can I set the cache-control header for specific content-types?</p>