Open rahul286 opened 11 years ago
We have developed a WordPress plugin which uses your module and this an issue I am talking about here - https://github.com/rtCamp/nginx-helper/issues/10
This would be quite nice feature!
function true_purge_all(){
$this->unlinkRecursive(RT_WP_NGINX_HELPER_CACHE_PATH, false);
$this->log( "* * * * *" );
$this->log( "* Purged Everything!" );
$this->log( "* * * * *" );
}
This needs to be changed. You are incorrectly assuming that the php user has access to the nginx cache. When using php-fpm with multiple pools that will not be the case. Nginx and php-fpm are seperate systems. This results in a permission denied error because the pool user is not the nginx user. This is not an end user configuration problem, this is an incorrect assumption that all users will use single pools owned by the user running nginx.
Maybe consider making something like this a requirement so we can hook into nginx instead of trying to recurisively unlink files with php. http://labs.frickle.com/nginx_ngx_cache_purge/
@aeroclown
To avoid all such workarounds, it will be great for a module to directly have a purge all at nginx-level only.
@aeroclown by the way I am not developer of ngx_cache_purge module. This issue is more like feature request to the developer.
Oops, I was looking at the wrong project when I posted this, I was looking at the nginx helper for wordpress or is this the same. I was suggesting that they add an ngx purge or cache module for nginx as a requirement instead of what they are doing with a recursive unlink.
Thats a good suggestion though, I was doing the group mods in reverse. I feel rather stupid that I did it the other way.
@aeroclown nginx-helper is here - https://github.com/rtCamp/nginx-helper
We are developer of that wordpress plugin. We wish purge-all to be handled by nginx-module that is why I posted a request here.
see potential workaround using http headers https://drupal.org/node/2094425
this would sound like a limited variant of the varnish ban method. ban in varnish can invalidate cache based on regular expression matching of any header. the problem is that this operation could potentially take a long time, thus ban are just added to a list and checked on match, and then you activate a process that throws away cache entries if they match a ban while varnish is not too busy.
Any hope on this?
+1 on this feature.
+2 on this feature
Thanks for good work. I have a request from me and many of my readers...
We need a purge ALL option.
Currently we can do...
fastcgi_cache_purge zone_name key
What we need to do....
fastcgi_cache_purge zone_name EVERYTHING
or may be
fastcgi_cache_flush zone_name
Use-case:
We have modified theme or deployed new codes. Entire cache becomes invalid.
As of now we need to do
rm -rf
on cache-location which is cumbersome and bit risky.If a new directive gets added, that will be really helpful.