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:
- remove cache folder, but then you need to restart nginx.
- 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:
Sorry, folks my question is a duplicate of this thread
Re: what is the correct way to flush/delete proxy_cache withoutrestartnginx? (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:
Hello!
On Tue, Jan 01, 2013 at 09:39:32AM -0500, oleksandr-shb wrote:
Sorry, folks my question is a duplicate of this thread
Re: what is the correct way to flush/delete proxy_cache withoutrestartnginx? (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.
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;
…
}