Far future Expires header ignored

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Far future Expires header ignored

Postby cranfan » 15. February 2013 11:54

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.
cranfan
 
Posts: 5
Joined: 07. November 2011 15:36
XAMPP Version: 1.8.3-3
Operating System: Windows XP SP3

Re: Far future Expires header ignored

Postby JonB » 18. February 2013 18:00

I suspect the browser cache can detect the change in the file.
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 80 guests