-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fast follow: post parent ID cache V2 #5420
Conversation
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.
Added a few notes.
Something that occurred to me over the weekend is that the second group may cause problems. Until now running wp_cache_flush_group( 'posts' )
would clear all the post object related data but with this change a developer now needs to flush the new group too.
Unlike the recent change to introduce the post-queries
group, I'm not sure the post_parent
group provides enough benefit for back-compat break as the individual post objects do not use the last changed date filling persistent caches with unreachable keys.
* The post parent cache is used to store the parent ID of a post for quick retrieval. | ||
* | ||
* @since 6.4.0 | ||
* @access private |
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 think this can be public as with the other cache warming functions.
Co-authored-by: Peter Wilson <[email protected]>
This is a documented way of clearing caches. You should call We could reuse the cache group post and make the id something like this |
PR is based on #5386. It is simplier PR, that just changes the function name and prime the post parent cache on post save.
Trac ticket: https://core.trac.wordpress.org/ticket/59188
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.