views:

151

answers:

1

Since I version all my css/js/images, they never "change". It might go from sprite.4.png to sprite.5.png, but sprite.4.png will never change.

Anyway, it seems pointless for the browsers to be checking for modified versions and receiving 304 responses, so what do I need to put in .htaccess to prevent these last modified look ups?

Right now I have,

<ifmodule mod_expires.c>
  <filesmatch "\.(jpg|gif|png|css|js|swf)$">
   ExpiresActive On
   ExpiresDefault "access plus 10 years"
   </filesmatch>
</ifmodule>

but I still see the 304's in the browsers. What else do I need? Thanks.

+1  A: 

You could also add:

Cache-Control: public

to the headers. That will allow clients and proxies to cache the output

In .htaccess:

   <filesmatch "\.(jpg|gif|png|css|js|swf)$">
       Header set Cache-Control "max-age=1000000000, public"
   </filesmatch>
Philippe Leybaert
@Philippe, it worked! You also gave me some new keywords to search google for and read more about, and I found this: http://www.askapache.com/htaccess/apache-speed-last-modified.html along with some other great tips. Thanks!
Keith Bentrup