-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Introduce new queries cache group
#4077
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
Conversation
peterwilsoncc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking it might be better to use different groups for each query type, ie network-queries, post-queries, etc. This will allow for more precise targeting of affected groups in cache plugins, either for the purpose of making the groups non-persistent or doing group deletes.
|
@peterwilsoncc Done 👍 |
peterwilsoncc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
felixarntz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tillkruss Technically that looks good and IMO reasonable, though I could see how for certain environments this could be a quite impactful change (for better or for worse).
I'm not 100% convinced, but I feel like this would be a candidate that requires needs-dev-note on the Trac ticket. cc @peterwilsoncc @spacedmonkey
That seems reasonable. |
SergeyBiryukov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
Note: It appears that we use both underscores and dashes in cache group names in core. At a glance, underscores seem more common, so I went back and forth for a bit on whether to suggest using underscores here, e.g. post_queries. But we're not super consistent with this, so I guess either way is fine 🙂
|
Yep, I went with dashes since it was used more recently it appears. Kills my OCD. |
spacedmonkey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this change. I think it opens up lots of doors for changing caching behaviours. It will also allows for better measuring for how much of caches query based caches.
I think it change is too big for late WP 6.2, but should be committed early 6.3.
It was your idea after all ❤️🔥 |
|
Committed. 82cd434 |
As per discussion with @spacedmonkey on Slack, this PR changes to storing all WordPress 6.1 query-caching in the
queriesgroup for more flexibility.wp_cache_add_non_persistent_groups( 'post-queries' )*-queriesgroupsTrac ticket: https://core.trac.wordpress.org/ticket/57625
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.