homepage Welcome to WebmasterWorld Guest from 54.196.196.72
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Do my caching make sense?
rlopes




msg:4452337
 5:51 pm on May 11, 2012 (gmt 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>

 

phranque




msg:4452568
 12:46 pm on May 12, 2012 (gmt 0)

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.

SteveWh




msg:4452986
 10:20 pm on May 13, 2012 (gmt 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).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved