-
Notifications
You must be signed in to change notification settings - Fork 140
Enhance object-cache.php drop-in placement logic to support updating to a newer version of the file
#1047
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
Enhance object-cache.php drop-in placement logic to support updating to a newer version of the file
#1047
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. |
westonruter
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, but with some test assertion hardening.
Co-authored-by: Weston Ruter <westonruter@google.com>
…com:WordPress/performance into enhance/server-timing-dropin-update-support
|
PR is updated to address the remaining feedback as well as to cater for the |
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.