Welcome to WebmasterWorld Guest from 54.167.78.17

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Do my caching make sense?

     
5:51 pm on May 11, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:Sept 11, 2009
posts: 128
votes: 0


I've inserted the following directives in my htaccess
Is it "correct"?

<IfModule mod_headers.c>
ExpiresActive On
ExpiresDefault "access plus 1 year"
</IfModule>
FileETag None
<FilesMatch "\.(ico|gz|JPG|jpg|jpeg|png|gif|js|css|swf)$">
Header unset Cache-control
Header set Expires "Wed, 28 Apr 2013 20:00:00 GMT"
</FilesMatch>
12:46 pm on May 12, 2012 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10544
votes: 8


the ExpiresActive and ExpiresDefault directives are mod_expires directives, so i'm not sure why you are checking mod_headers.
also, you should know if your server environment has any given module configured or not so you shouldn't need the IfModule.
why are you disabling ETags?
i'm not sure a fixed expiration date is a good idea.

but yeah syntactically that looks correct and might even be perfect for your application.
10:20 pm on May 13, 2012 (gmt 0)

Preferred Member

5+ Year Member

joined:July 25, 2006
posts: 460
votes: 0


also, you should know if your server environment has any given module configured or not so you shouldn't need the IfModule

Although if you have different versions of your site running in differing environments, the checks can ensure that the code works without error in all of them, or ensure that it continues to function even if the environment changes (such as webhost altering the config).