# Firefox cache images more than cache-control: max-age

**URL:** <https://www.ruby-forum.com/t/firefox-cache-images-more-than-cache-control-max-age/222376>\
**Category:** NGINX\
**Created:** [August 27, 2012, 2:01pm UTC](https://www.ruby-forum.com/t/firefox-cache-images-more-than-cache-control-max-age/222376 "2012-08-27T14:01:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [August 27, 2012, 2:01pm UTC](https://www.ruby-forum.com/t/firefox-cache-images-more-than-cache-control-max-age/222376/1 "2012-08-27T14:01:19Z")

</div>

Hello.

Some visitors of my site complain about their Firefox is pulling images  
from cache, whereas it should not do that, because images on the site  
are changing few times a day. In other words, .png images that are  
static, always have same file name, but few times a day they get  
overwriten with new ones. When visitor loads web page, fresh versions of  
images must be displayed, but Firefox ofted pulls them from it’s cache.  
I don’t have any report of other browsers than FF is doing that problem.  
However, I don’t found issue myself; browsing all the time with Firefox  
on Linux at home, and also few Firefox on Windows on work and everything  
is OK. This is why I cannot track issue very well.

In nginx configuration I allowed little bit of caching (6 minutes) so  
when visitor loads page again in a short period of time they can be  
cached versions, but not for a long time, say few hours! So I set:

```
     location / {
         root html;
         index index.html index.htm;
         autoindex on;
         expires 6m;
     }

```

Checking with Live HTTP Headers I’m getting these responses for images:

[http://46.102.240.202/images/gfs/06z/pcs/pcs\_18.png](http://46.102.240.202/images/gfs/06z/pcs/pcs_18.png)

GET /images/gfs/06z/pcs/pcs\_18.png HTTP/1.1  
Host: 46.102.240.202  
User-Agent: Mozilla/5.0 (X11; Linux x86\_64; rv:10.0.4) Gecko/20100101  
Firefox/10.0.4  
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8  
Accept-Language: en-us,en;q=0.7,hr;q=0.3  
Accept-Encoding: gzip, deflate  
Connection: keep-alive  
Referer:  
[http://maps.meteoadriatic.net/gfs-karte-aktualne/eksperimentalni-pcs-index-brn.html](http://maps.meteoadriatic.net/gfs-karte-aktualne/eksperimentalni-pcs-index-brn.html)

HTTP/1.1 200 OK  
Server: [meteoadriatic.net](http://meteoadriatic.net)  
Date: Thu, 23 Aug 2012 13:05:55 GMT  
Content-Type: image/png  
Content-Length: 31313  
Last-Modified: Thu, 23 Aug 2012 09:34:29 GMT  
Connection: keep-alive  
Expires: Thu, 23 Aug 2012 13:11:55 GMT  
Cache-Control: max-age=360  
Accept-Ranges: bytes

So I think everything should be set to cache images for 360 seconds (6  
minutes) and when image is loaded after that time pass, they have to be  
pulled from server again, not from cache.

What can I do to help those users who has to refresh page manually every  
time they want to see fresh images?

Thanks in advance,  
Ivan
