Skip to content
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

Allow global and non-persistent groups to be filtered #76

Closed
tillkruss opened this issue Jan 4, 2022 · 6 comments
Closed

Allow global and non-persistent groups to be filtered #76

tillkruss opened this issue Jan 4, 2022 · 6 comments
Assignees
Labels
Needs Discussion Anything that needs a discussion/agreement WP Core Work relates to inclusion in WP Core only

Comments

@tillkruss
Copy link
Member

tillkruss commented Jan 4, 2022

See https://core.trac.wordpress.org/ticket/54303 and https://core.trac.wordpress.org/ticket/47884

This is a rarely requested feature, but given the complete lack of flexibility should be addressed.

Core calls wp_cache_add_global_groups() very early and using apply_filters() is unlikely an option.

Adding and removing groups mid-request could be catastrophic, so having an ignore-list may be the best approach:

define( 'WP_OBJECT_CACHE_NON_GLOBAL_GROUPS' => [ 'users', 'usermeta' ] );
define( 'WP_OBJECT_CACHE_NON_GLOBAL_GROUPS' => 'users, usermeta' ); // support strings as well?

We should do the exact same for the wp_cache_add_non_persistent_groups() call.

@tillkruss tillkruss changed the title Allow global caching groups to be filtered Jan 4, 2022
@tillkruss tillkruss changed the title Allow global cache groups to be filtered Jan 4, 2022
@tillkruss tillkruss self-assigned this Jan 4, 2022
@tillkruss tillkruss removed their assignment Jan 4, 2022
@tillkruss
Copy link
Member Author

@JanThiel is taking a go at this.

@tillkruss tillkruss added this to In progress in [Focus] Object Cache Jan 4, 2022
@JanThiel
Copy link

WordPress PR (currently still without tests): WordPress/wordpress-develop#2149

@peterwilsoncc
Copy link
Contributor

Just some notes of a discussion Till and I had on the PR.

It occurred to me that it might be possible to use a filter for the global groups & require site owners wishing to make use of it to require_once wp-includes/plugin.php, this is similar to how enable_loading_object_cache_dropin works. WordPress/wordpress-develop#2149 (comment)

@tillkruss asked some follow up questions, see the following few comments in the thread.

@tillkruss tillkruss added Needs Decision Anything that needs a decision for next steps Needs Discussion Anything that needs a discussion/agreement and removed Needs Review Anything that requires code review Needs Decision Anything that needs a decision for next steps labels Feb 7, 2023
@joemcgill joemcgill added the WP Core Work relates to inclusion in WP Core only label Jun 26, 2024
@joemcgill
Copy link
Member

This is not something we're currently focused on, so I'm going to close this so the any related discussion about this issue can remain in the related Trac ticket: https://core.trac.wordpress.org/ticket/54303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Discussion Anything that needs a discussion/agreement WP Core Work relates to inclusion in WP Core only
6 participants