Enhance object-cache.php drop-in placement logic to support updating to a newer version of the file#1047
Merged
felixarntz merged 10 commits intotrunkfrom Mar 13, 2024
Conversation
…to a newer version of the file.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
3 tasks
swissspidy
reviewed
Mar 12, 2024
westonruter
approved these changes
Mar 12, 2024
Member
westonruter
left a comment
There was a problem hiding this comment.
LGTM, but with some test assertion hardening.
mukeshpanchal27
approved these changes
Mar 13, 2024
Co-authored-by: Weston Ruter <[email protected]>
…com:WordPress/performance into enhance/server-timing-dropin-update-support
Member
Author
|
PR is updated to address the remaining feedback as well as to cater for the |
swissspidy
approved these changes
Mar 13, 2024
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.
Summary
See #1042 (comment): Given that PR contains changes to the
object-cache.phpdrop-in which require updating it in order for the underlying Server-Timing logic to still be loaded correctly, the logic to place that file needs to support updating an older version of the file to its latest version that comes with Performance Lab.So far, the logic was naively checking for purely the existence of the drop-in via its version constant, without checking whether that version is the latest version though.
Relevant technical choices
PERFLAB_OBJECT_CACHE_DROPIN_LATEST_VERSIONcontains always the latest version of the drop-in. For that, we need a separate constant as we can't access thePERFLAB_OBJECT_CACHE_DROPIN_VERSIONconstant defined in the plugin's ownobject-cache.copy.phpfile, as that file is never actually loaded.perflab_object_cache_dropin_versionis introduced, purely to facilitate unit testing related to thePERFLAB_OBJECT_CACHE_DROPIN_VERSIONconstant. This filter is needed because constants can't be "un-defined", so code relying on constants is otherwise untestable.Checklist
[Focus]orInfrastructurelabel.[Type]label.no milestonelabel.