-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Meta: Allow registering post meta keys that skip query cache invalidation #11290
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
Open
ellatrix
wants to merge
11
commits into
WordPress:trunk
Choose a base branch
from
ellatrix:fix/meta-query-cache-invalidation
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+710
−62
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4a2c9b4
Meta: Allow registering meta keys that skip query cache invalidation
ellatrix 547d556
Register RTC meta keys for all post types
ellatrix 5a78b63
Tests: Add tests for invalidates_query_cache meta registration
ellatrix cccef6f
Support subtype-registered meta keys in cache invalidation lookup
ellatrix cf75d00
Support per-post-type invalidates_query_cache behavior
ellatrix e98e160
Restrict invalidates_query_cache to post meta, add reasoning comments
ellatrix c0a7b55
Fix coding standards: align equals signs in test file
ellatrix 314106c
Exclude non-cacheable meta keys from keyless meta_value queries
ellatrix 3189f29
Tests: Update registerMeta test expectations for invalidates_query_cache
ellatrix 55359d8
Tests: Update user meta test expectation for invalidates_query_cache
ellatrix 97ac27d
Fix coding standards: align array double arrows in test expectations
ellatrix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@ellatrix and I discussed the complexity addition of a
NOT INquery here. It seems like it would be not more complex with it since it would be a query onvalueonly.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 do lean towards removing the query modification and just leaving it as an edge case with a note. These kinds of meta value only queries should anyway be rare and discouraged (imo).
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.
Have you checked how plugins are using meta_query to know how much of an edge case this is?
I agree it should be discouraged, but I don't know how prevalent this is.
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.
How would you search for plugins using
meta_valuewithoutmeta_key?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 can't think of a specific regex for that, so I would suggest manually checking the code. Otherwise, I think we shoud lean towards being as defensive as possible and not assuming it's an edge case.
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.
How would you check them manually other than just a few?
What does defensive mean in this case? I guess you're arguing for keeping the query adjustment and excluding these keys?