title: apache caching js files
body: <p>I've configured Apache under windows to enable cache like this</p>
  
  <pre><code>    LoadModule expires_module modules/mod_expires.so
      LoadModule headers_module modules/mod_headers.so
      LoadModule deflate_module modules/mod_deflate.so
  
  ExpiresActive On
  
  
  
  ExpiresDefault "access plus 3 days"
  
  ExpiresByType image/x-icon "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType image/jpg "access plus 1 month"
  ExpiresByType image/gif "access plus 1 month"
  ExpiresByType image/jpeg "access plus 1 month"
  ExpiresByType application/pdf "access plus 1 month"
  
  
  &lt;IfModule mod_headers.c&gt;
  # YEAR
  &lt;FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf)$"&gt;
    Header set Cache-Control "max-age=29030400"
  &lt;/FilesMatch&gt;
  # WEEK
  &lt;FilesMatch "\.(js|css|swf)$"&gt;
    Header set Cache-Control "max-age=604800"
  &lt;/FilesMatch&gt;
  # 45 MIN
  &lt;FilesMatch "\.(html|htm|txt)$"&gt;
    Header set Cache-Control "max-age=2700"
  &lt;/FilesMatch&gt;
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>When I try to open js file directly in browser (to test) by refreshing again and again then each time I get response status 200 with Firebug. Its not sending status "304 Not Modified". Have u any idea how can I achieve this. Following is the output of Firebug headers. </p>
  
  <pre><code>Response Header
  Date        Sat, 13 Aug 2011 01:18:15 GMT
  Server      Apache/2.2.19 (Win32) PHP/5.3.6
  Last-Modified   Sat, 13 Aug 2011 01:18:15 GMT
  Etag        W/"100000000171d-34f08-4aa5f022d9780"
  Accept-Ranges   bytes
  Content-Length  216840
  Cache-Control   max-age=604800
  Expires     Tue, 16 Aug 2011 01:18:15 GMT
  Keep-Alive      timeout=5, max=100
  Connection      Keep-Alive
  Content-Type    application/javascript
  
  Request Header
  
  Accept          text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Language en-us,en;q=0.5
  Accept-Encoding gzip, deflate
  Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
  Connection          keep-alive
  Cookie          PHPSESSID=5k947khv1j27itd7mtp5evtg07
  If-Modified-Since   Sat, 13 Aug 2011 01:03:42 GMT
  If-None-Match   W/"100000000171d-34f08-4aa5f022d9780"
  Cache-Control   max-age=0
  </code></pre>