I have successfully implemented expires headers however, for several days I have been stumped by one thing. This article: http://www.tipsandtricks-hq.com/how-to-add-far-future-expires-headers-to-your-wordpress-site-1533 states
Keep in mind that when you use expires header the files are cached in the browser until it expires so do not use this on files that changes frequently.
Other sites indicate the same in my reading. But this doesn't seem to be true. I have updated an image, using the same name, several times. Each time I update and refresh my browser, the new image (with the same name) displays. I understand from this article that the old image should display unless I use a new name.
Do you happen to know where the misunderstanding is?
I have verified that the image in question has expires headers set on it:
Request Headers:
Host domain.com
User-Agent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28 FirePHP/0.5
Accept image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 115
Connection keep-alive
Referer http://domain.com/index.php
Cookie __utma=1.61479883.1332439113.1332783348.1332796726.4; __utmz=1.1332439113.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);PHPSESSID=lv2hun9klt2nhrdkdbqt8abug7; __utmb=1.33.10.1332796726; __utmc=1; ck_authorized=true
x-insight activate
If-Modified-Since Mon, 26 Mar 2012 21:55:33 GMT
Cache-Control max-age=0
Response Headers:
Date Mon, 26 Mar 2012 22:06:50 GMT
Server Apache/2.2.3 (CentOS)
Connection close
Expires Wed, 25 Apr 2012 22:06:50 GMT
Cache-Control max-age=2592000
Relevant config (.htaccess):
<IfModule mod_expires.c>
# Enable Expires Headers for this directory and sub directories that don't override it
ExpiresActive on
# Set default expiration for all files
ExpiresDefault "access plus 24 hours"
# Add Proper MIME-Type for Favicon
AddType image/x-icon .ico
# Set specific expriation by file type
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType image/ico "access plus 1 month"
ExpiresByType image/icon "access plus 1 month"
</IfModule>
You seem to be confusing keeping the cached image and using the cached image. The browser keeps the cached image, as configured. However, the browser will not use the cached image if it know it is not current. Revalidation and expiration are two different things.
You should use "Cache-Control max-age=2592000, public", so the browser would save the file.