# Cache problem - not expiring

**URL:** <https://www.ruby-forum.com/t/cache-problem-not-expiring/204403>\
**Category:** NGINX\
**Created:** [March 11, 2011, 10:00am UTC](https://www.ruby-forum.com/t/cache-problem-not-expiring/204403 "2011-03-11T10:00:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 11, 2011, 10:00am UTC](https://www.ruby-forum.com/t/cache-problem-not-expiring/204403/1 "2011-03-11T10:00:15Z")

</div>

nginx 0.8.49

Hello List,

have a problem with cached images which dont want to expire from cache.  
i use nginx as proxy with 2 ApacheBackends. On backend an image was  
updated  
by ftp but nginx still serves cached image for hours. i had to delete it  
manually…  
in nginx.conf i use:

proxy\_cache\_min\_uses 1;  
proxy\_cache\_valid 200 5m;  
proxy\_cache\_path /usr/local/nginx/proxy\_temp/ levels=1:2  
keys\_zone=ramdisk:1000m inactive=10m max\_size=2000M;

I need some help, in which direction i should look for problems?

Thanks,  
Hajo

---

<div class="post-metadata">

**Author:** ![Hajo\_Locke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/c89c15/32.png) [@Hajo\_Locke](https://www.ruby-forum.com/u/Hajo_Locke)\
**Post date:** [March 11, 2011, 1:07pm UTC](https://www.ruby-forum.com/t/cache-problem-not-expiring/204403/2 "2011-03-11T13:07:49Z")

</div>

Hello!

On Fri, Mar 11, 2011 at 09:58:27AM +0100, Hajo Locke wrote:

> proxy\_cache\_min\_uses 1;  
> proxy\_cache\_valid 200 5m;  
> proxy\_cache\_path /usr/local/nginx/proxy\_temp/ levels=1:2  
> keys\_zone=ramdisk:1000m inactive=10m max\_size=2000M;
> 
> I need some help, in which direction i should look for problems?

Check headers (Expires, Cache-Control) returned by backends. They  
take precedence over proxy\_cache\_valid specified (unless ignored  
with proxy\_cache\_ignore\_headers).

Maxim D.
