Quantcast

best way to empty nginx cache

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

best way to empty nginx cache

Jérôme Loyet
Hi all,

what is the best and quickest way to empty the whole cache (set via
proxy_cache_path) ?

I'm developing an small web site which allow my customers to empty
their site cache.

I would do:
1- find /path/to/cache -type f -exec rm {}\;
2- gracefull reload nginx to clear the shared memory used to handle cache

what do you think ?

++ jerome

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: best way to empty nginx cache

Igor Sysoev
On Wed, Jun 03, 2009 at 11:30:49AM +0200, J?r?me Loyet wrote:

> Hi all,
>
> what is the best and quickest way to empty the whole cache (set via
> proxy_cache_path) ?
>
> I'm developing an small web site which allow my customers to empty
> their site cache.
>
> I would do:
> 1- find /path/to/cache -type f -exec rm {}\;
> 2- gracefull reload nginx to clear the shared memory used to handle cache
>
> what do you think ?

Only 1st item is enough. Reload does not clear shared memory.


--
Igor Sysoev
http://sysoev.ru/en/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: best way to empty nginx cache

Jérôme Loyet
2009/6/3 Igor Sysoev <[hidden email]>:

> On Wed, Jun 03, 2009 at 11:30:49AM +0200, J?r?me Loyet wrote:
>
>> Hi all,
>>
>> what is the best and quickest way to empty the whole cache (set via
>> proxy_cache_path) ?
>>
>> I'm developing an small web site which allow my customers to empty
>> their site cache.
>>
>> I would do:
>> 1- find /path/to/cache -type f -exec rm {}\;
>> 2- gracefull reload nginx to clear the shared memory used to handle cache
>>
>> what do you think ?
>
> Only 1st item is enough. Reload does not clear shared memory.

Thx igor

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: best way to empty nginx cache

karlo13
This post has NOT been accepted by the mailing list yet.
In reply to this post by Igor Sysoev
Hi sir,

Is this code enough when clearing nginx cache?
find /path/to/cache -type f -exec rm {}\;

or should I kill and start nginx also?
Loading...