Page 1 of 1

Far future Expires header ignored

PostPosted: 15. February 2013 11:54
by cranfan
Following the advice given by Yahoo / YSlow at http://developer.yahoo.com/performance/rules.html#expires I am trying to set a far future Expires header for my images.

In my .htacess I have:

Code: Select all
<filesMatch "\.(jpg|jpeg|png|gif)$">
Header unset Pragma
FileETag None
Header unset ETag
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2014 20:00:00 GMT"
Header unset Last-Modified
</filesMatch>


Using Live HTTP Headers in Firefox I can see that there is no ETag and the Expires date shows as 2014. Also, looking at the cache I can confirm the Expires date and that there is no ETag or Server Last Modified date.

Again following the information given at YSlow I was expecting that if I now alter an image without altering its filename no changes would take effect until the Expires date is reached. YSlow points out that “if you use a far future Expires header you have to change the component's filename whenever the component changes”.

However, testing on localhost with XAMPP any change I make to an image is still immediately reflected on the web page if I refresh it.

Is this a local server thing or have I misunderstood how this is intended to work?

Thanks.

Re: Far future Expires header ignored

PostPosted: 18. February 2013 18:00
by JonB
I suspect the browser cache can detect the change in the file.