# Proxy-cache refresh

**URL:** <https://www.ruby-forum.com/t/proxy-cache-refresh/198245>\
**Category:** NGINX\
**Created:** [October 28, 2010, 3:40pm UTC](https://www.ruby-forum.com/t/proxy-cache-refresh/198245 "2010-10-28T15:40:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![okkezSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Post date:** [October 28, 2010, 3:40pm UTC](https://www.ruby-forum.com/t/proxy-cache-refresh/198245/1 "2010-10-28T15:40:08Z")

</div>

Hello

We are using the nginx proxy\_cache module to cache big media files - per  
default for 24h.  
Is there a way to tell nginx to check regularly on the backend servers  
if the file still exists or was being updated?

Thanks for your help and kind regards,  
Nik

Posted at Nginx Forum:

> **[proxy-cache refresh](https://forum.nginx.org/read.php?2,145316,145316#msg-145316)**
>
> Hello We are using the nginx proxy\_cache module to cache big media files - per default for 24h. Is there a way to tell nginx to check regularly on the backend servers if the file still exists or was being updated? Thanks for your help and kind...

---

<div class="post-metadata">

**Author:** ![niwo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/9f8e36/32.png) [@niwo](https://www.ruby-forum.com/u/niwo)\
**Post date:** [October 28, 2010, 5:07pm UTC](https://www.ruby-forum.com/t/proxy-cache-refresh/198245/2 "2010-10-28T17:07:31Z")

</div>

Hello!

On Thu, Oct 28, 2010 at 09:38:31AM -0400, niwo wrote:

> Hello
> 
> We are using the nginx proxy\_cache module to cache big media files - per  
> default for 24h.  
> Is there a way to tell nginx to check regularly on the backend servers  
> if the file still exists or was being updated?

Not exactly.

Best aproach currently available is to use

proxy\_cache\_use\_stale updating;

and set lower expire time. This way nginx will re-download file  
from backends periodically, while still serving most of the  
requests from cache.

Maxim D.

---

<div class="post-metadata">

**Author:** ![niwo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/9f8e36/32.png) [@niwo](https://www.ruby-forum.com/u/niwo)\
**Post date:** [October 30, 2010, 2:46pm UTC](https://www.ruby-forum.com/t/proxy-cache-refresh/198245/3 "2010-10-30T14:46:24Z")

</div>

Thanks for your answer Maxim!

Most important for us is that files disappear from the cache within 60  
min after deletion from the origins  
So, I think for us the best way to go at the moment is to us the  
cache\_purge module in order to delete files from the cache after they  
have been delete from the origin as setting the expire time at 60 min is  
not a good option for us.

Kind regards,  
Nik

Posted at Nginx Forum:

> **[Re: proxy-cache refresh](https://forum.nginx.org/read.php?2,145316,145968#msg-145968)**
>
> Hello We are using the nginx proxy\_cache module to cache big media files - per default for 24h. Is there a way to tell nginx to check regularly on the backend servers if the file still exists or was being updated? Thanks for your help and kind...
