Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Contributor Rolf Allard van Hagen

    (@ravanh)

    OK, I checked and compared a ‘regular’ multi-site install on the same server with the multi-network install and I found this:

    REGULAR NETWORK
    (checked on primary site, 1 sub-site and network admin, all logged in as super admin)
    1. Admin bar Purge Cache, front end: nothing (expecting page cache only)
    2. Admin bar Purge Cache, site admin: nothing (expecting site cache)
    3. Admin bar Purge Cache, network admin: clears entire cache (expecting site cache only)
    4. Purge Entire Cache button on the Nginx Helper super admin page: clears entire cache (expected)
    5. Redis Cache plugin Clear Cache button: clears entire cache (expected)

    Summary: Front-end and admin purge cache links fail, network admin bar purge link works but only the Purge Entire Cache button works as expected.

    MULTI-NETWORK – PRIMARY NETWORK
    (checked on primary site of primary network and primary site of secondary network, 1 sub-site on primary and secondary networks, and primary and secondary network admin, all logged in as super admin)
    1. Admin bar Purge Cache, front end: nothing (expecting page cache only)
    2. Admin bar Purge Cache, site admin: nothing (expecting site cache)
    3. Admin bar Purge Cache, network admin: nothing (expecting site cache only)
    4. Purge Entire Cache button on the Nginx Helper super admin page: nothing (expecting entire cache)
    5. Redis Cache plugin Clear Cache button: clears entire cache (expected)

    Summary: all Nginx Helper purge links/buttons fail.

    Note: Redis Cache plugin settings (host/port/prefix) are matched on Nginx Helper settings on all networks.

    So… what to make of this? Is there something wrong with the server setup, plugin configurations or is it a bug?

    Grzegorz.Janoszka

    (@grzegorzjanoszka)

    The same here. This plugin can’t delete the local cache. I wonder what it really does.

    Plugin Contributor Rahul Prajapati

    (@rahulsprajapati)

    Hello @ravanh, @grzegorzjanoszka

    We are looking into the issue, will update you soon. Meanwhile, can you confirm if you’re using the latest version 2.0.1.

    Grzegorz.Janoszka

    (@grzegorzjanoszka)

    Rahul,
    I fixed it today and planned to do some more testing and update this ticket later on today.
    Anyway what worked for me was to set RT_WP_NGINX_HELPER_CACHE_PATH. My directory is exactly the same as the default value, but somehow it didn’t work with the default value. After I set it to /var/run/nginx-cache it most likely started to work.
    Anyway, I looked at the code a little bit and I found something that you could consider: there may be a configuration option to clean the feeds. Right now they are always cleaned which is, at least in my case, not necessary.
    Ah, I have the latest version of course.
    Thanks for this great plugin and your support!

    ubtnao

    (@ubtnao)

    Hello
    Clear chache works only with purge module of nginx, otherwise it will never work with directory because always nginx changes permissions to files and group permissions etc.

    I tried to fix it but somehow always will do changes so forget that and setup nginx purge cache module, it works with it.

    Plugin Contributor Rolf Allard van Hagen

    (@ravanh)

    Yes, Nginx Helper, Redis plugin and WordPress latest. All running on Ubuntu Xenial with EasyEngine 3.8.1, Nginx nginx/1.14.0 (EasyEngine), PHP v7.0.32-4+ubuntu16.04.1+deb.sury.org+1, php-redis 4.1.1-1+ubuntu16.04.1+deb.sury.org+10, redis-serve 5:5.0.0-3chl1~xenial1

    I noticed there is a minor version upgrade for redis available so I’ll do that tonight and see if there is any change.

    Plugin Contributor Rolf Allard van Hagen

    (@ravanh)

    
    # nginx -V
    nginx version: nginx/1.14.0 (EasyEngine)
    built with OpenSSL 1.0.2g-fips  1 Mar 2016 (running with OpenSSL 1.0.2g  1 Mar 2016)
    TLS SNI support enabled
    configure arguments: 
    --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' 
    --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' 
    --prefix=/usr/share/nginx 
    --conf-path=/etc/nginx/nginx.conf 
    --http-log-path=/var/log/nginx/access.log 
    --error-log-path=/var/log/nginx/error.log 
    --lock-path=/var/lock/nginx.lock 
    --pid-path=/run/nginx.pid 
    --http-client-body-temp-path=/var/lib/nginx/body 
    --http-fastcgi-temp-path=/var/lib/nginx/fastcgi 
    --http-proxy-temp-path=/var/lib/nginx/proxy 
    --http-scgi-temp-path=/var/lib/nginx/scgi 
    --http-uwsgi-temp-path=/var/lib/nginx/uwsgi 
    --with-debug 
    --with-pcre-jit 
    --with-http_ssl_module 
    --with-http_stub_status_module 
    --with-http_realip_module 
    --with-http_auth_request_module 
    --with-http_addition_module 
    --with-http_geoip_module 
    --with-http_gzip_static_module 
    --with-http_image_filter_module 
    --with-http_v2_module 
    --with-http_sub_module 
    --with-http_xslt_module 
    --add-module=/usr/src/packages/BUILD/debian/modules/headers-more-nginx-module 
    --add-module=/usr/src/packages/BUILD/debian/modules/nginx-auth-pam 
    --add-module=/usr/src/packages/BUILD/debian/modules/nginx-cache-purge 
    --add-module=/usr/src/packages/BUILD/debian/modules/nginx-echo 
    --add-module=/usr/src/packages/BUILD/debian/modules/ngx-fancyindex 
    --add-module=/usr/src/packages/BUILD/debian/modules/nginx-lua 
    --add-module=/usr/src/packages/BUILD/debian/modules/nginx-upload-progress 
    --add-module=/usr/src/packages/BUILD/debian/modules/nginx-upstream-fair 
    --add-module=/usr/src/packages/BUILD/debian/modules/ngx_http_substitutions_filter_module 
    --add-module=/usr/src/packages/BUILD/debian/modules/memc-nginx-module 
    --add-module=/usr/src/packages/BUILD/debian/modules/srcache-nginx-module 
    --add-module=/usr/src/packages/BUILD/debian/modules/HttpRedisModule 
    --add-module=/usr/src/packages/BUILD/debian/modules/redis2-nginx-module 
    --add-module=/usr/src/packages/BUILD/debian/modules/ngx_devel_kit 
    --add-module=/usr/src/packages/BUILD/debian/modules/set-misc-nginx-module
    

    Purge and Redis modules seem to be present.

    Plugin Contributor Chandra Patel

    (@chandrapatel)

    Hello RavanH,

    I apologies for the delay.

    We’ve tested following use cases with latest version of Nginx Helper plugin and EasyEngine V4 & V3.8.1.

    REGULAR NETWORK

    1. Admin bar Purge Cache, front end: nothing (expecting page cache only)
    – Yes, this is not working. We are working on to resolve this.
    2. Admin bar Purge Cache, site admin: nothing (expecting site cache)
    – We’re unable to replicate this issue.
    3. Admin bar Purge Cache, network admin: clears entire cache (expecting site cache only)
    – Yes, it will purge entire page cache. Needs to change Admin bar menu name to “Purge Entire Cache” for network admin.
    – (expecting site cache only) – Can you please give more details on this use case?

    MULTI-NETWORK – PRIMARY NETWORK

    1. Admin bar Purge Cache, front end: nothing (expecting page cache only)
    – Yes, this is not working. We are working on to resolve this.
    2. Admin bar Purge Cache, site admin: nothing (expecting site cache)
    – We’re unable to replicate this issue.
    3. Admin bar Purge Cache, network admin: nothing (expecting site cache only)
    – Yes, it will purge entire page cache. Needs to change Admin bar menu name to “Purge Entire Cache” for network admin.
    – (expecting site cache only) – Can you please give more details on this use case?
    4. Purge Entire Cache button on the Nginx Helper super admin page: nothing (expecting entire cache)
    – We’re unable to replicate this issue.

    Can you please provide the logs of Redis and Nginx Helper plugin for above use cases to debug the issue further?
    – You can get Nginx Helper plugin log file path from plugin settings page.
    – For Redis log, Please follow this URL. https://stackoverflow.com/questions/16337107/how-to-access-redis-log-file/16340289#16340289

    Also, can you please check in Nginx Helper log whether page cache key which Nginx Helper plugin trying to purge is same as in Redis server?

    Thanks,

    Plugin Contributor Rolf Allard van Hagen

    (@ravanh)

    Hi Chandra,

    I did this:
    1. primary site home page: purge cache from admin bar
    2. primary site admin dashboard: purge cache from admin bar
    3. network admin dashboard: purge cache from admin bar
    4. network admin Nginx Helper settings page: Purge Entire Cache button

    The results are:
    A. no entries in the redis-server.log file
    B. nginx debug log file sais:

    
    2019-02-15 09:47:06  | INFO | * * * * *
    2019-02-15 09:47:06  | INFO | * https://vivarais.net Purged! * 
    2019-02-15 09:47:06  | INFO | No Cache found.
    2019-02-15 09:47:06  | INFO | * * * * *
    2019-02-15 09:47:16  | INFO | * * * * *
    2019-02-15 09:47:16  | INFO | * Purged Everything! * 
    2019-02-15 09:47:16  | INFO | Total 12882 urls purged.
    2019-02-15 09:47:16  | INFO | * * * * *
    2019-02-15 09:47:37  | INFO | * * * * *
    2019-02-15 09:47:37  | INFO | * Purged Everything! * 
    2019-02-15 09:47:37  | INFO | Total 696 urls purged.
    2019-02-15 09:47:37  | INFO | * * * * *
    

    What I notice is:
    a. it shows nothing at the first purge attempt
    b. the second attempt sais “No cache found” while there is a cache and it’s not empty, as shown by the third attempt 10 seconds later.

    Plugin Contributor Rolf Allard van Hagen

    (@ravanh)

    Hi, any update on this? It’s getting more and more annoying to have to explain to site admins that the clear cache does not work and they need to way for the cache to expire on it’s own…

    Which leads me to another bug on my install: the cache does not get cleared on publishing a new post, even though that option is checked on Network > Settings > Nginx Helper.

    I’m pretty sure this used to work, so I’ll have to try and find out what changed…

    Plugin Contributor Rolf Allard van Hagen

    (@ravanh)

    What it basically boils down to (it seems) is that purging with patern nginx-cache:* works while nginx-cache:httpGETexample.com* returns nothing… Weird.

    Plugin Contributor Rolf Allard van Hagen

    (@ravanh)

    O, hang on… I now find out on my test server that all GET requests keys are stored with the prefix nginx-cache: even though I’ve set a different one on Settings > Nginx Helper, matching the prefix used by Redis plugin (as set in wp-config by the WP_CACHE_KEY_SALT constant). I’ve tested setting the prefix with RT_WP_NGINX_HELPER_REDIS_PREFIX too but still, all GET keys are stored with the default prefix.

    The purge process does use the prefix defined in settings or by constant, so that explains the failing purges.

    Can’t figure out WHY though…

    Plugin Contributor Rolf Allard van Hagen

    (@ravanh)

    Ah… it’s defined in /etc/nginx/common/redis-php7.php

    So, the Nginx Helper prefix setting MUST be “nginx-cache:” as long as no nginx file is changed manually? I thought it had to match the Redis plugin prefix.

    So this means all sites/networks on the same server will get all their caches cleared when one site/network does a “purge all” ?

    Plugin Contributor Rolf Allard van Hagen

    (@ravanh)

    Remains the Purge Cache menu not working on the front end admin bar. This is caused be the fact that the purge_all method is only hooked to admin_init so does not check any purge action on the front end.

    I suggest simply removing the Purge Cache button from the front end admin bar to avoid confusion. See https://github.com/rtCamp/nginx-helper/pull/179

    Plugin Contributor Chandra Patel

    (@chandrapatel)

    Hello RavanH,

    I apologize for the delay in reply.

    It’s getting more and more annoying to have to explain to site admins that the clear cache does not work and they need to way for the cache to expire on its own…

    We’ve tested with possible use cases, but purging from site/network admin working fine.

    I’ve set a different one on Settings > Nginx Helper, matching the prefix used by Redis plugin (as set in wp-config by the WP_CACHE_KEY_SALT constant).

    WP_CACHE_KEY_SALT constant used by Redis plugin for object cache and it’s not used by Nginx Helper for page cache.

    So, the Nginx Helper prefix setting MUST be “nginx-cache:” as long as no nginx file is changed manually?

    Yup. If prefix changed in nginx config file then need to change in Nginx Helper prefix setting as well.

    I thought it had to match the Redis plugin prefix.

    No, Redis/Nginx Helper plugin prefix is different.

    So this means all sites/networks on the same server will get all their caches cleared when one site/network does a “purge all”?

    Site Admin: Admin bar Purge Cache will purge the page cache of that site.
    Network Admin: Admin bar Purge Cache will purge the page cache of all the sites.

    Remains the Purge Cache menu not working on the front end admin bar. This is caused be the fact that the purge_all method is only hooked to admin_init so does not check any purge action on the front end.

    Yup. But instead of removing “Purge Cache” from front-end admin bar, we’ve made changes and now it will purge the current page cache. Also, we’ve rename button to “Purge Current Page” in the front-end admin bar. PR have been merged but the plugin is not released yet with this change. Please let me know your suggestion on this.

    Is site/network admin “Purge Cache” working fine after changing prefix in nginx helper plugin?

    Thanks,

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Nginx Helper does not clear the cache II’ is closed to new replies.