Purge whole cache zone

Hi, I am interested if it is possible to invalidate whole cache zone.
Now it
is possible to invalidate single cache item using cache key and third
party
module Cache Purge. What I need is to remove all cache items when
hitting
some location. So far the ideas are next:

  1. remove cache folder, but then you need to restart nginx.
  2. create several cache_zones and use the one stored with the name
    stored in
    memcache. So when cache needs to be invalidated the backend will update
    cache_zone name record stored in memcache. It seems to be like a
    possible
    way, but have no idea how to implement it.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,234605,234605#msg-234605

Sorry, folks my question is a duplicate of this thread
http://forum.nginx.org/read.php?2,30833,32763#msg-32763 (solution). So,
the
solution is to remove cache folder and kill nginx processes. Not killing
processes caused troubles with blank pages for me.

rm -rf /data/nginx/proxy_cache2 && killall -HUP nginx

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,234605,234606#msg-234606

Hello!

On Tue, Jan 01, 2013 at 09:39:32AM -0500, oleksandr-shb wrote:

Sorry, folks my question is a duplicate of this thread
http://forum.nginx.org/read.php?2,30833,32763#msg-32763 (solution). So, the
solution is to remove cache folder and kill nginx processes. Not killing
processes caused troubles with blank pages for me.

rm -rf /data/nginx/proxy_cache2 && killall -HUP nginx

Correct solution would be to remove all items (subdirectories
and/or files) within the cache folder, not the cache folder
itself.


Maxim D.
http://nginx.com/support.html

Is it possible to have each server{} block write to it’s own cache
directory? Or otherwise identify cached pages by server{} block?

The aim is to make it easy to clear all cached pages for a specific site
on
a box hosting multiple sites.

On Jan 2, 2013, at 12:25 , Tom Barrett wrote:

Is it possible to have each server{} block write to it’s own cache directory? Or
otherwise identify cached pages by server{} block?

The aim is to make it easy to clear all cached pages for a specific site on a
box hosting multiple sites.

proxy_cache_path /path/to/cache/server1 keys_zone=SERVER1:10m;

server {
server_name server1.domain.com;
proxy_cache SERVER1;

}

proxy_cache_path /path/to/cache/server2 keys_zone=SERVER2:10m;

server {
server_name server2.domain.com;
proxy_cache SERVER2;

}

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs