WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. 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'm trying to speed up my site a bit. How can I add Expire headers to images I upload? Must this be done with Apache configuration, or is there a setting or plugin to do the job?

share|improve this question
up vote 2 down vote accepted

This can be done with Apache configuration, I have used this snippet in the past in .htaccess:

ExpiresActive On 
ExpiresByType image/gif "access plus 1 month" 
ExpiresByType image/png "access plus 1 month" 
ExpiresByType image/jpeg "access plus 1 month"

Can be set up with plugin as well. W3 Total Cache (which I currently use) can do that among other things.

Overall this is not a huge performance factor. Modern browsers are smart enough about caching images even without expires set.

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.