-
Notifications
You must be signed in to change notification settings - Fork 130
Allow disabling Server-Timing entirely using PERFLAB_DISABLE_SERVER_TIMING
constant
#795
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
Allow disabling Server-Timing entirely using PERFLAB_DISABLE_SERVER_TIMING
constant
#795
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.
Thanks for the PR @felixarntz. The Server-Timing API remains accessible through the handy mini plugin you've crafted: https://gist.github.com/felixarntz/63c05392dbf7d51cc7f8f4a424b1ff39.
For a comprehensive review, here's a rundown of the steps to reproduce the issue:
- Introduce
define( 'PERFLAB_DISABLE_SERVER_TIMING', true );
in your config.php file. - Verify the deactivation of Server-Timing API.
- Implement the Server Timing Extra mini plugin from https://gist.github.com/felixarntz/63c05392dbf7d51cc7f8f4a424b1ff39.
- Confirm the successful reactivation of Server-Timing API.
Correct me if i miss anything here. Thanks!
… (and thus initializes) the Server-Timing API.
Thanks @mukeshpanchal27, good catch! In 93afb03 I implemented a fix that ensures that, even when another plugin uses the Server-Timing API, at least the header output is still being suppressed if it is generally disabled. This way it is ensured there are no fatal errors, but the header won't be sent. |
Noting that there are some unit test failures, however these are also present in |
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.
Thanks @felixarntz for the changes, LGTM!
Summary
Fixes #794
Note that the branch is based on the branch from #784 since it touches a lot of related code. Once that PR is merged, this one can have its base updated to
trunk
.Testing
PERFLAB_DISABLE_SERVER_TIMING
totrue
in yourwp-config.php
.object-cache.php
drop-in is not placed.Checklist
[Focus]
orInfrastructure
label.[Type]
label.no milestone
label.