Hi @tezalsec!
and it is not active on admin pages.
Can you post your diagnostics, because Redis object cache is either active everywhere, or not at all.
Have you tried flushing your entire Redis database? redis-cli FLUSHALL
Hi Till,
the issue I am describing stands apart from what you are describing. Apart from these links/actions not working, Redis is functioning perfectly.
I flush all the time. And I wrote a little function that withholds redis from certain pages, including the entire admin area (except the redis settings). I’ll paste it here, maybe it helps someone.
/*
* Redis activation
**/
function wp_redis_activate() {
$url = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
// activate only on redis config page, to get status
if (strpos(strtolower($url), 'redis') !== FALSE) { return TRUE; }
// no redis as logged in admin (except for above redis setting page)
if(wp_login_cookie_exists()) { return FALSE; }
// exclusion pages, expand if needed
$excluded_pages = array("wp-admin", "admin", "login", "logout", "login", "ajax", "json", "404", "cancel", "contact", "cart", "checkout", "video", "event", "session", "post_type");
// loop through exclusion pages
foreach ($excluded_pages as $excluded_page) {
if (strpos(strtolower($url), $excluded_page) !== FALSE) {
// exclusion page found, do not activate
return FALSE;
}
}
// no exclusion reasons found, activate redis
return TRUE;
}
if (wp_redis_activate()) {
define( 'WP_REDIS_DISABLED', false ); //activate
} else {
define( 'WP_REDIS_DISABLED', true ); //deactivate
}
@tezalsec: Excluding URLs will break your cache data. An object cache must be enabled on all pages.
Really? Wow, I really thought it was functioning fine. Frontend pages are faster than without it. The CLI monitoring behaves exactly as I would hope to when visiting pages.
Having Redis active on my backend gave me way too much outdated admin data, I rather wait a little longer and get fresh data in the backend.
I guess you suspect my issues are a result of the excluding of urls? Because these issues only happened recently, long after setting up my solution of excluding urls.
Thank you.
Really? Wow, I really thought it was functioning fine.
Yeah, page caching and object caching is vastly different.
I guess you suspect my issues are a result of the excluding of urls?
Yes, it is. You can exclude cache groups however.
Check out the WP_REDIS_IGNORED_GROUPS constant:
https://github.com/rhubarbgroup/redis-cache/wiki/Configuration-Options#wp_redis_global_groups-default-see-below