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?
1 Answer
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.