pantheon-systems / wp-redis

WordPress Object Cache using Redis.
https://wordpress.org/plugins/wp-redis/
GNU General Public License v2.0
225 stars 68 forks source link

WP redis calling mysql... #342

Closed erikdemarco closed 2 years ago

erikdemarco commented 2 years ago

My site is faster with this plugin. But it could be much much faser if this plugin is not calling mysql for 'wp_redis_do_redis_failback_flush' EVERY single pageload. I dont understand what is the purpose of that? I succesfully managed to get my page to load only from object cache with zero mysql call. Just this 1 call hurting the performance.

danielbachhuber commented 2 years ago

Hey @erikdemarco,

Here's some of the history on the feature: https://github.com/pantheon-systems/wp-redis/pull/22

If you'd like to disable it, and understand the consequences of doing so, you can define( 'WP_REDIS_DISABLE_WAKEUP_FLUSH', true );

Hope this helps clarify!

erikdemarco commented 2 years ago

@danielbachhuber I see what you mean. But can't we just use something like try, catch block to detect error? Then if there is error we flush it. Instead of manually call sql every single load. Sql is really prone to race condition for big sites. Thats why most of them use cache to reduce mysql call.