Forum: NGINX Purge whole cache zone

Posted by oleksandr-shb (Guest)
on 2013-01-01 15:12
(Received via mailing list)
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
Posted by oleksandr-shb (Guest)
on 2013-01-01 15:40
(Received via mailing list)
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
Posted by Maxim Dounin (Guest)
on 2013-01-01 21:30
(Received via mailing list)
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 Dounin
http://nginx.com/support.html
Posted by Tom Barrett (Guest)
on 2013-01-02 09:26
(Received via mailing list)
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.
Posted by Igor Sysoev (Guest)
on 2013-01-02 09:47
(Received via mailing list)
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;
    ...
}
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.