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
428 stars 149 forks source link

Do not use Redis for unauthenticated users #427

Closed loixiyo closed 1 year ago

loixiyo commented 1 year ago

Hi,

I am using WPFastestCache and the developer told me that Redis Cache can affect the cache generation. He told me that it would be better if the Redis Cache is only used for authenticated users.

This way:

Is this possible with any configuration or hook?

Thanks!

tillkruss commented 1 year ago

He told me that it would be better if the Redis Cache is only used for authenticated users.

The WPFastestCache developer doesn't seem to understand object caching in WordPress. His request is not possible, without risking data corruption.

loixiyo commented 1 year ago

I would be more than happy if you explained a bit more before just closing the ticket.

Are you saying that the cache that WPFastestCache plugin does not depend on the results that Redis Cache is storing? So it does not matter if the users are authenticated or not, the Redis cache will store results to SQL queries, right?

Regards.

tillkruss commented 1 year ago

Sure thing. Object caching happens for nearly all requests. Fronted, backend, API. Logged in or not.

If your object cache (Redis) is warm, then the "page cache generation" would will be faster as well.

If your object cache is cold (was just flushed) the the page cache generation would be a bit slower, because it will simultaneously warm up the object cache (which is fine).