Easyengine and Redis object cache

Redis object cache in WordPress sometimes doesn't work nice. Making changes in settings within some plugins doesn't get recognized by Redis properly. The solutions can vary.


How I discovered this problem?
I simply noticed that changes in settings on AffiliateWP, Yith Affiliate Premium, or any other affiliate plugin are not being registered properly in Redis cache.

What does the problem look like?
The settings being saved for the first or maybe even second time work just fine. After that, once you make more changes in the settings, and if you refresh the page or leave the settings and come back, you will notice that the settings are not saved nor registered as being changed at all.

Serverpilot has nice tutorial on how to configure the redis object cache. Before I installed and connected redis object cache on my WordPress site, everything worked perfectly. Once I connected my site to use redis, the issues described got repeated.

Siteground‘s shared hosting uses Memcached for object cache. I had no problem at all using these plugins. This only confirms that issue lies only with redis.

What is the solution to the problem then?
There are several examples on how to bypass these issues before (or if) they get fixed by I don’t know who, whoever. Let’s check the workarounds below.

  • If you have this possibility, use Memcached.
  • Try flushing Redis cache every time you change something in the settings… or
  • For EasyEngine users flushing Redis cache might not work within the plugin (it did not for me).
    Seems like Redis and the Nginx helper plugin do not communicate properly. Flushing cache worked on Serverpilot though, but Serverpilot recommends different plugin, which works very nice and flushes the redis cache when you tell it so.
    Your best bet here, for EE, is to ssh to your server and clear the object cache via command line every time you make changes within that particular plugin (AffiliateWP or Yith Affiliate Premium, or other if you have one).
    ee site clean example.com --object

That’s it. If someone has better idea or if I find a better one I’ll put it here.

Leave a reply

Please enter your comment!
Please enter your name here