title: How to use different cache control header for different filenames with .htaccess?
body: <p>I am trying to allow caching of images that will never change (there will be only new images and those will have different URL already...)</p>
  
  <p>BUT, there are 2 folders with images, name of which doesn't change, but their content does, these are:</p>
  
  <pre><code>*profile/mini*
  *profile/thumb*
  </code></pre>
  
  <p>All other images can be cached by browser.</p>
  
  <p>This was my attempt:</p>
  
  <pre><code>&lt;FilesMatch "\.(ico|jpg|jpeg|png|gif)$"&gt;
      Header set Cache-Control "max-age=691200 must-revalidate, public"
      &lt;FilesMatch "profile/(mini|thumb)"&gt;
          Header set Pragma "no-cache"
          Header set Cache-Control "max-age=0 no-store, no-cache, must-revalidate"
          Header set Expires "Sun, 2 Feb 2014 17:00:00 GMT"
      &lt;/FilesMatch&gt;
  &lt;/FilesMatch&gt;
  </code></pre>
  
  <p>but it doesn't work. Images placed in pfoile/thumb are being cached still, However when I changed it to:</p>
  
  <pre><code>&lt;FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css)$"&gt;
      Header set Pragma "no-cache"
      Header set Cache-Control "max-age=0 no-store, no-cache, must-revalidate"
      Header set Expires "Sun, 2 Feb 2014 17:00:00 GMT"
  &lt;/FilesMatch&gt;
  </code></pre>
  
  <p>images have been refreshed correctly. What am I missing? Is "nesting" of <code>FilesMatch</code> rules even allowed?</p>