Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I ran across these suggested htaccess edits. Is this a good practice? Is this something I should implement on my wordpress site?:

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
share|improve this question

migrated from wordpress.stackexchange.com Apr 18 '12 at 13:33

This question came from our site for WordPress developers and administrators.

Yes, it is a good practice, but no, it is not on topic here. BTW: It must be access plus 1 year, note the plus. :) – toscho Apr 18 '12 at 3:43
Thanks for the comment – Tim Apr 18 '12 at 15:24
up vote 2 down vote accepted

This is definitely good practice. Having the browser cache pages and resources is a great way to speed up page loading as well as reduce bandwidth usage on your server.

I recommend checking out Google's PageSpeed for more tips on how to improve the performance of your web pages.

share|improve this answer
Thanks for the link and comment – Tim Apr 18 '12 at 15:25

yes, this is great practice.

I would also encourage you to checkout appcache. If you add one year to any file, it's good to make it browser-ready (AddType text/cache-manifest .appcache)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.