rhubarbgroup / redis-cache

A persistent object cache backend for WordPress powered by Redis. Supports Predis, PhpRedis, Relay, replication, sentinels, clustering and WP-CLI.
https://wordpress.org/plugins/redis-cache/
GNU General Public License v3.0
425 stars 148 forks source link

Prevent `read error on connection` timeouts when flushing #490

Closed webd-uk closed 10 months ago

webd-uk commented 11 months ago

This update moves the flushing of Redis cache to the "shutdown" hook so that a lengthly cache flush doesn't cause "read error on connection" error notices.

It also adds a Settings API error when filesystem credentials are not forthcoming (rather than not doing anything as is the case currently).

tillkruss commented 10 months ago

Closing in favor of #491.

tillkruss commented 10 months ago

@webd-uk: I think your solution might be this.

Alternatively, starting with Redis 6.2, setting the lazyfree-lazy-user-flush in the redis.conf configuration directive to yes changes the default flush mode to be asynchronous.