Welcome to WebmasterWorld Guest from 174.129.72.165

Forum Moderators: Ocean10000 & incrediBILL & phranque

Do my caching make sense?

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

5+ Year Member



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)

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



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)

5+ Year Member



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).
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month