Join the community today
Register Now

Wordpress Redis Cache at Nginx Level + WP Super Cache

Discussion in 'Blogs & CMS usage' started by dorobo, Dec 14, 2015.

  1. dorobo

    dorobo Active Member

    420
    104
    43
    Jun 6, 2014
    Ratings:
    +162
    Local Time:
    8:58 PM
    latest
    latest
    Do I have to install or can I also install WP Super Cache if I'm already using redis cache at the nginx level + redis object cache plugin?

    I would try it anyway but I'd like to know if it's necessary.

     
  2. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    no need redis cache at nginx level replaces wp super cache
     
  3. dorobo

    dorobo Active Member

    420
    104
    43
    Jun 6, 2014
    Ratings:
    +162
    Local Time:
    8:58 PM
    latest
    latest
    thanks George.

    I have another question with Redis. So unlike memcache where you set the memory that you want it to use, Redis can use all of the available memory?
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  5. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    8:58 AM
    latest
    10
    How's that? Redis Cache is a database in memory cache and a caching plugin is a static/browser cache. I've been using Redis + Cache Enabler and works great. Conducting tests show that having a caching plugin has a much better server response time then having just redis even with the 2 required plugins or am I doing something wrong here?

    I've tested both ways, with caching plugin + redis w/ the 2 required plugins | with Cache Enabler by itself w/ no redis cache
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    best redis wordpress solution = redis cache at nginx level + redis object wp plugin (for db cache)

    however technically if you are talking in terms of functionality, redis cache at nginx level does what wp super cache and cache enabler does = offload the load from php-fpm by generating wp page level caching either at redis/memory level or at nginx static page file level (wp super cache or cache enabler).

    I suspect it's redis object wp plugin (for db cache) that is making the difference, so try with just Cacher Enabler + redis object wp plugin (for db cache) and see

    so try a proper comparison between
    • wp super cache only
    • wp super cache + redis object wp plugin (for db cache)
    • cache enabler only
    • cache enabler + redis object wp plugin (for db cache)
    • redis nginx level cache + redis object wp plugin (for db cache)
    • redis nginx level cache + redis object wp plugin (for db cache) + cache enabler
     
  7. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    8:58 AM
    latest
    10
    wow was I wrong lol! Disabled Cache Enabler - Followed ALL steps outlined in the post regarding the Redis install ( miss 2 things ) and wow - MUCH faster!!

    All this time I've been installing all 3 Cache Enabler + both redis plugins, installing it wrong on quite a few VPS's
    I have ALLOT of updates to do tonight lol!
     
  8. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    8:58 AM
    latest
    10
    What I did notice though is

    X-Cache is always a HIT while X-Cache-2 is always BYPASS - what is X-Cache-2 for?
     
  9. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    hehe - yes provided Redis server is installed and configured, Redis Nginx level cache + Redis object cache will be much faster than WP Super Cache or Cache Enabler. FYI, if you read the code and nginx syntax used WP Super Cache = Cache Enabler basically so not much difference just Cache Enabler seems to work better and easier from the WP PHP Plugin configuration side of things.

    That's normal as there's only 2 possible outputs for $srcache_store_status BYPASS or STORE. Where STORE only happens when a subrequest isn't available in Redis cache and has status codes 200, 301 or 302 i.e. when $srcache_fetch_status = MISS. Once, $srcache_fetch_status = HIT, then $srcache_store_status becomes BYPASS as it doesn't have to to store the subrequest in Redis cache.

    see openresty/srcache-nginx-module · GitHub

    and openresty/srcache-nginx-module · GitHub
     
    Last edited: Dec 15, 2015
  10. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Last edited: Dec 24, 2015
  11. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    8:58 AM
    latest
    10
    that's awesome! using cloudflare railgun requires memcached to be on. ever since i switched everyone over to using redis, i turned memcached off. But now i have to have them both on. do you foresee any issues with running both memcached for railgun and redis?
     
  12. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    oh didn't know railgun needed memcached !

    i have no problems with memcached server and redis server running together usually :)
     
  13. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    8:58 AM
    latest
    10
    ok thanks @eva2000! - I didn't know either till I installed the railgun daemon on a new VPS and it failed to start so I turned memcached on and it ran just fine thereafter.
     
  14. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  15. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    8:58 AM
    latest
    10
    currently have a few sites ( testing ) on easyengine's HHVM with Redis cache and seems to work very well. It speeds up the site at least by 20% faster then php7 + redis
     
  16. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  17. ndha

    ndha Member

    83
    10
    8
    Sep 28, 2014
    Ratings:
    +29
    Local Time:
    7:58 PM
    1.27
    10.6
    @eva2000 i don't know what's wrong actually..
    everytime i use redis nginx level cache + redis object wp plugin (for db cache) + Php 5.6.16, my site using Adsense is show zero click/earning, visitor still stable about 3-4k/day, i try this for 3 days and earning still zero..
    but when i switch back to centmin WP Supercache Option 22, Cliks/earning is back to normal still with visitor 3-4k/day..
    That's why i still using WP Super Cache... :(
     
  18. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    strange i wouldn't know much about that as i don't use adsense on wordpress

    anyone else run into this ? @RoldanLT @Matt Williams
     
  19. ndha

    ndha Member

    83
    10
    8
    Sep 28, 2014
    Ratings:
    +29
    Local Time:
    7:58 PM
    1.27
    10.6
    Yesss, i feel that...strange enough..
    i'm absolutely sure follow all your instructions for nginx redis, also i'd tried fresh install but result still same, It's Fast but Earning is Zero, lol..
    i'd tried Easy Engine with Redis too, and result still same for Blog with Adsense..
    So i'm stick with Centmin WP Super Cache now..
     
  20. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:58 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    well thanks for heads up, definitely something to look at !