Closed nixsee closed 1 year ago
It looks like the WP_REDIS_SERIALIZER
is used for PhpRedis and Relay and will set the Redis::OPT_SERIALIZER
option.
And WP_REDIS_IGBINARY
will use the igbinary_*()
methods to compress data.
I think we should remove WP_REDIS_SERIALIZER
, it's not safe anyhow to use the JSON or MSGPACK options.
Thanks for the quick response!
But its still not quite clear to me, so please bear with me.
I'd like to use the most performant serializer available. I think that is igbinary, but it is not clear to me whether that is igbinary_*()
or Relay\Relay::OPT_SERIALIZER, Redis::SERIALIZER_IGBINARY
or Relay\Relay::OPT_SERIALIZER, 'igbinary
.
Though, it sounds like you plan to remove WP_REDIS_SERIALIZER
, so that just leaves define('WP_REDIS_IGBINARY', true);
If its helpful, I'm happy to submit an initial PR to remove WP_REDIS_SERIALIZER
for your review.
Closed via 4bbcf34da35e60526727209bc5a9cc8235745f85.
I'm very sorry - I just got (made) time to come back and finish this issue/PR off, but see that you did it yourself today...
No worries!
I have Redis Object Cache installed on my WordPress site and have configured Relay on my server. It connects and works fine. In wp-config.php I have the following two lines:
And both are recognized in the diagnostics as
2
andtrue
, respectively.It isn't clear to me if I should be using one or the other, or both. When I step through the code with Xdebug, it seems like these two settings are in conflict/competition with each other. If
WP_REDIS_SERIALIZER
is set, it never seems to get to the point where it checks for/usesWP_REDIS_IGBINARY
- for example, here https://github.com/rhubarbgroup/redis-cache/blob/develop/includes/object-cache.php#L2722Also, in the Scaling section of the readme, it shows
define( 'WP_REDIS_SERIALIZER', 'igbinary' );
but I was under the impression that you needed to set it as I did above (
Redis::SERIALIZER_IGBINARY
)So, I'm hoping you could please clarify a bit further here or in the Readme what each one does, why you'd use one over the other, and how to set them. Again, I'm using Relay, but I suppose instructions for both Relay and phpredis would be useful (if there's a difference).
Thanks!