-
Notifications
You must be signed in to change notification settings - Fork 142
Description
Performance Lab currently opens its own output buffer at template_redirect and sends the Server-Timing response header during template_include:
performance/plugins/performance-lab/includes/server-timing/class-perflab-server-timing.php
Lines 239 to 245 in 8368b58
| public function add_hooks(): void { | |
| if ( $this->use_output_buffer() ) { | |
| add_action( 'template_redirect', array( $this, 'start_output_buffer' ), PHP_INT_MIN ); | |
| } else { | |
| add_filter( 'template_include', array( $this, 'on_template_include' ), PHP_INT_MAX ); | |
| } | |
| } |
In WordPress 6.9 we can now leverage the template enhancement output buffer introduced via Core-43258 (see r60936).
When the wp_start_template_enhancement_output_buffer() function exists, we can skip starting our own output buffer, and instead use the wp_template_enhancement_output_buffer filter.
Additionally, when output buffering is not desired, the new wp_before_include_template action can be used to send the Server-Timing instead of using the template_include filter.
See also:
Metadata
Metadata
Assignees
Labels
Type
Projects
Status