Cache registered patterns#22
Merged
Merged
Conversation
Member
|
I tracked down how core caches patterns: https://github.com/WordPress/wordpress-develop/blob/b482707cf7cfca3edc44f19ecb55125689bedbd2/src/wp-includes/class-wp-theme.php#L1839 Need to look in to if this is theme specific patterns like it suggests it would be or not. This also seems relevant, as we are talking about woo patterns specifically: https://github.com/woocommerce/woocommerce/blob/be7352ca6d57e4a41e2d9347510583b1b6a6de89/plugins/woocommerce/src/Blocks/BlockPatterns.php#L127 |
…y our own transient is required in this case
brettsmason
reviewed
Oct 30, 2025
brettsmason
left a comment
Member
There was a problem hiding this comment.
I originally hoped we could get around using our own transient here, but unfortunately it seems its not possible. I've uncluded some comments detailing the reasoning in this case.
brettsmason
approved these changes
Oct 30, 2025
DanielHudson2
approved these changes
Oct 30, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is be a measurable saving to requests by caching the patterns.
Is it OK to do a 5 min cache on these? Presumably they don't change very frequently but it could be confusing to users when they are caught out by cached data.