Support » Plugin: Nginx Helper » Support for purging all

  • Currently the only way of purging the entire cache is by directly deleting the files from the specified path. This requires that the PHP process is running with the same user as the Nginx process, as the cache files is owned by that user with 600 permissions. This is quite often not the case, and the purge request will silently fail.

    I suggest one of these solutions:

    *) When requesting a purge of everything, fire a request against http://example.com/purge/*, which can then be configured in Nginx to purge everything.

    *) Use an input field where the admin can specify an url to use to purge everything.

    *) Implement support for the default fastcgi_cache_purge allowing wildcard purging using request “PURGE http://example.com/*” (like in their example).

Viewing 4 replies - 1 through 4 (of 4 total)
  • Sorry to jump in here.

    Implement support for the default fastcgi_cache_purge allowing wildcard purging using request “PURGE http://example.com/*” (like in their example).

    Are you aware that fastcgi_cache_purge is only available as commercial subscription?

    Ref: https://nginx.org/r/fastcgi_cache_purge

    Disclaimer: I am not the developer of this plugin and am no way related to the author/s of the plugin. Actually, I hate every plugin that is based on fastcgi cache or proxy cache in Nginx, because clearing the cache (fastcgi or proxy) is available only as commercial subscription and all such plugins (that are based on fastcgi cache or proxy cache) use a workaround to clear the cache. That workaround often involves compromising on the permission thus the security of the site. If anyone has commercial subscription, a plugin can be created to clear the cache without compromising the security (at a fraction of the cost of the commercial subscription). Keeping the PHP running as the same user as Nginx is actually a bad design.

    Hi Pothi,

    Yes, I’m aware that fastcgi_cache_purge is a feature in the commercial version. The main reason of my request is not to support this premium feature, but to get a method of wildcard purging without PHP having access to the files. I myself do not use the commercial version but is using my own custom script that listens for purge request to remove cached files. It would be great if this plugin could give the opportunity to in some way make a http request for wildcard purging.

    Hi Jon,

    using my own custom script that listens for purge request to remove cached files.

    This is certainly an interesting workaround.

    Thanks for clarifying and providing a hint for the workaround.

    Plugin Author Rahul Bansal

    (@rahul286)

    @xpoon I recommend using redis-based full page caching option in nginx-helper. It has a wildcard purge feature.

    You may read – https://easyengine.io/wordpress-nginx/tutorials/single-site/redis_cache-with-conditional-purging – to understand how redis-based full page cache is used.

    That being said nginx-helper uses it internally so there is no explicit UI. But we would be happy to accept a pull request on nginx-helper which does that. Or you can create an issue on Github issue https://github.com/rtCamp/nginx-helper

    If you use EasyEngine, then in v4, redis cache is the default and only caching method supported.

    • This reply was modified 9 months, 3 weeks ago by Rahul Bansal.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Support for purging all’ is closed to new replies.