-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caching "counts" cache group #114
Comments
I don’t know why it’s disabled by default. I also actually ever disabled the counts group. Let me know what you find out when digging into this. |
The problem is I cannot find a way of enabling Issue reported on WP bugtracer https://core.trac.wordpress.org/ticket/47884#ticket |
Don't allow groups that were manually removed using `WP_REDIS_IGNORED_GROUPS` constant to be added to the ignored groups list. * FIxes rhubarbgroup#114 * Fixes rhubarbgroup#74 * Ref: https://core.trac.wordpress.org/ticket/47884#ticket
* Update add_non_persistent_groups() Don't allow groups that were manually removed using `WP_REDIS_IGNORED_GROUPS` constant to be added to the ignored groups list. * FIxes #114 * Fixes #74 * Ref: https://core.trac.wordpress.org/ticket/47884#ticket * Fix error in logic * Incorporate pr review feedback * improved implementation * fix typo * Added new filter: redis_add_non_persistent_groups This makes it possible to override the default ignored groups set by WordPress core without any complex, hard to follow logic attempting to filter out the default groups only when they were removed using `WP_REDIS_IGNORED_GROUPS` constant. * update filter name to use existing naming scheme
Hi,
I am trying to remove
counts
from ignored cached groups. I did adddefine( 'WP_REDIS_IGNORED_GROUPS', ['plugins'] );
and checked if the constant is being loaded properly and it works. However it turns out that Wordpress runswp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) );
in wp-includes/load.php on line 586 (https://core.trac.wordpress.org/browser/branches/5.2/src/wp-includes/load.php#L586) which addscounts
to ignored groups back regardless of theWP_REDIS_IGNORED_GROUPS
setting.What should I do to enable
counts
caching? Also, do you have any idea why counts caching is disabled by default? I did study thewp_count_posts()
function (https://core.trac.wordpress.org/browser/branches/5.2/src/wp-includes/post.php#L2527) that sets this cache key and it seems to handle all the invalidation etc. so it seems really wasteful to recount posts on every request by default. This was already discussed in #74 but no solution was provided there.The text was updated successfully, but these errors were encountered: