Some help to tweak the .htaccess file
-
Hi
Since I found your plugin yesterday, it has made a considerable difference in speed @ http://bit.ly/1AhLPI2. After trying out different plugins following recommendations at gtmetrix.com & webpagetest.org, it helped improve gtmetrix results from under 88% (Page Speed Grade) & 75% at best (YSlow Grade) to 90 – 93% & 83 – 88%, respectively.
I discovered the plugin had placed this code at the bottom of the .htaccess code.
## BEGIN Expires Caching (Leverage Browser Caching) ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access 2 week”
ExpiresByType image/jpeg “access 2 week”
ExpiresByType image/gif “access 2 week”
ExpiresByType image/png “access 2 week”
ExpiresByType text/css “access 2 week”
ExpiresByType application/pdf “access 2 week”
ExpiresByType text/x-javascript “access 2 week”
ExpiresByType application/x-shockwave-flash “access 2 week”
ExpiresByType image/x-icon “access 2 week”
ExpiresDefault “access 2 week”
</IfModule>
## END Expires Caching (Leverage Browser Caching) ### END WP Performance Score Booster Settings
To help with browser caching, BEFORE using your plugin, I had had a recommendation to place some other code at the top of the .htaccess file, which I guess has a repetition of code at the beginning & end.
This other code at the top is:## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType text/css “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType text/x-javascript “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType image/x-icon “access 1 year”
ExpiresDefault “access 2 days”
</IfModule>
## EXPIRES CACHING ##- The fact is this does not seem to affect the site speed BUT is it safe to get rid of that at the top?
- I read somewhere, I think a recommendation from Gtmetrix (http://gtmetrix.com/add-expires-headers.html) that longer periods for expiration of the cache are better & that is probably what the author of the other code uses as a premise. You have “access 2 week”, they “access 1 year”, other files “access 1 month” & another author “access plus 1 year” for some files & others “access plus 1 month”.
What do you say about this? I just need the best option. - At webpagetest.org, the site http://bit.ly/1AhLPI2 somehow keeps getting mostly “F” in browser caching, although I must say at Gtmetrix.com ca 92% for browser caching. Could there be a problem with the analysis of webpagetest.org?
- Lastly, if I may ask, and this may be outside the scope of your plugin: even if I have used several image smush plugins (wp smush, EWWW Image Optimizer, etc) & they have nothing more to smush, “Compress Images” at webpagetest.org also keeps churning “F”. Could something here be wrong again? Gtmetrix’s “Optimize images” gives 81%, which I think is not too bad.
Your advice would be highly appreciated.
Regards
- The topic ‘Some help to tweak the .htaccess file’ is closed to new replies.