title: how to use mod_headers and mod_expires to cache
body: <p>I want to cache images and other files on my site, so what I did is made sure mod_headers and mod_expires with :-</p>
  
  <pre><code>/usr/sbin/httpd -l
  </code></pre>
  
  <p>then edited .htaccess to be:-</p>
  
  <pre><code>ExpiresActive On
  ExpiresDefault A0
  
  
  # Set up caching on media files for 1 year (forever?)
  &lt;FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$"&gt;
  ExpiresDefault A29030400
  Header append Cache-Control "public"
  &lt;/FilesMatch&gt;
  
  # Set up caching on media files for 1 week
  &lt;FilesMatch "\.(gif|jpg|jpeg|png|swf)$"&gt;
  ExpiresDefault A604800
  Header append Cache-Control "public"
  &lt;/FilesMatch&gt;
  
  # Set up 2 Hour caching on commonly updated files
  &lt;FilesMatch "\.(xml|txt|html|js|css)$"&gt;
  ExpiresDefault A9200
  Header append Cache-Control "proxy-revalidate"
  &lt;/FilesMatch&gt;
  
  # Force no caching for dynamic files
  &lt;FilesMatch "\.(php|htm)$"&gt;
  ExpiresActive Off
  Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
  Header set Pragma "no-cache"
  &lt;/FilesMatch&gt;
  
  &lt;Files 403.shtml&gt;
  order allow,deny
  allow from all
  &lt;/Files&gt;
  </code></pre>
  
  <p>But when I browse the site, every time the images reload and take too much time. Is there anything else I should do?</p>