# Nginx clear static file cache without restarting

**URL:** <https://www.ruby-forum.com/t/nginx-clear-static-file-cache-without-restarting/220554>\
**Category:** NGINX\
**Created:** [June 13, 2012, 8:05am UTC](https://www.ruby-forum.com/t/nginx-clear-static-file-cache-without-restarting/220554 "2012-06-13T08:05:35Z")\
**Posts on this page:** 2\
**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:** [June 13, 2012, 8:05am UTC](https://www.ruby-forum.com/t/nginx-clear-static-file-cache-without-restarting/220554/1 "2012-06-13T08:05:35Z")

</div>

i’m using nginx1.0.15 stable to serve static files, and with following  
configurations:

```
sendfile on;
tcp_nopush on;
tcp_nodelay on;
open_file_cache max=1048000 inactive=604800s;
open_file_cache_min_uses 1;
open_file_cache_valid 3600s;

```

here is my problem, how can i clear the static file cache without  
restarting nginx without ‘killall -HUP nginx’?

Posted at Nginx Forum:

> **[nginx clear static file cache without restarting](https://forum.nginx.org/read.php?2,227476,227476#msg-227476)**
>
> i'm using nginx1.0.15 stable to serve static files, and with following configurations: sendfile on; tcp\_nopush on; tcp\_nodelay on; open\_file\_cache max=1048000 inactive=604800s; open\_file\_cache\_min\_uses 1; open\_fi

---

<div class="post-metadata">

**Author:** ![chenmin7249](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f9ae1b/32.png) [@chenmin7249](https://www.ruby-forum.com/u/chenmin7249)\
**Post date:** [June 13, 2012, 12:37pm UTC](https://www.ruby-forum.com/t/nginx-clear-static-file-cache-without-restarting/220554/2 "2012-06-13T12:37:43Z")

</div>

Hello!

On Wed, Jun 13, 2012 at 02:04:56AM -0400, chenmin7249 wrote:

> here is my problem, how can i clear the static file cache without  
> restarting nginx without ‘killall -HUP nginx’?

No, the only way to reset open file cache is to restart worker  
processes. Sending SIGHUP to let nginx start new worker processes  
and gracefully shutdown old ones is the easiest way to do this.

And just to make sure it’s clear: restarting worker processes via  
SIGHUP doesn’t imply any downtime. All connections will be  
accepted and all requests will be handled, no animals will be  
harmed and so on.

Maxim D.
