WordPress.org

Ready to get started?Download WordPress

Forums

Nginx Proxy Cache Purge
Nginx proxy cache purge plugin (5 posts)

  1. John Levandowski
    Member
    Plugin Author

    Posted 3 years ago #

    If you are using an nginx server as a reverse proxy cache for apache I would like your feedback.

    I have created a plugin that clears the nginx cache when you update a post. It is available at http://wordpress.org/extend/plugins/nginx-proxy-cache-purge/

    This plugins requires that you have ngx_cache_purge module installed with nginx.

    Please reply and let me know if you have used this plugin and if it is working for you or if you have any questions. Also, please let me know what features you would like to have added to this plugin.

  2. moepstar
    Member
    Posted 3 years ago #

    Hey :)

    Thanks for creating this plugin, been looking/hoping for something like this for ages.

    Installed and set it up with only the most basic caching rules found in the NGINX Wiki and seems to work fine already with my WPMU (Multisite) 3.0.1 install.

    And even without the ngx_cache_purge module it seems to purge updated content (not for the main page, i.e. the main page shows last 5 posts, last post gets updated, main page shows post still as was before update) just fine so i wonder if that requirement has been changed?

    Anyways, looking forward to your response & keep up the good work :)

  3. John Levandowski
    Member
    Plugin Author

    Posted 3 years ago #

    Are you sure that nginx is caching your pages?

    Anyhow, this plugin will only function if you have the ngx_cache_purge module installed and with a

    location ~ /purge(/.*) {
    proxy_cache_purge staticfilecache "$scheme://$host$1";
    }

    or similar directive in your configuration as all the plugin really does is add a /purge/ after your domain so that example.com/page/ turns into example.com/purge/page/ and that page is called.

  4. moepstar
    Member
    Posted 3 years ago #

    From a few loadtests using ab from another server i'm pretty sure nginx does indeed cache my sites & pages - of course i've configured the vhost with (nginx) caching enabled, sorry for omitting this info from my initial post. To add, i'm running nginx 0.7.67-3 from Debian Squeeze.

    Regarding your blog-post about compiling nginx from source and adding the module i/you might want to add to maybe only allow access to the /purge location to localhost and deny all others - i for one don't want everyone and his dog to be able to purge my cache ;)

  5. GRAQ
    Member
    Posted 3 years ago #

    Hi jlevandowski

    The plugin works great.

    with the introduction and wider use of Custom Post Types, it would be useful to be able to identify other pages to purge the cache. Two obvious places that come to mind are 1) CPT archive pages / CPT pages and 2) Parent pages.

    Perhaps even a generic way to trigger other pages to be have their cache purged on publish/update.

    Does that make sense?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic