Performance Lab currently opens its own output buffer at template_redirect and sends the Server-Timing response header during template_include:
|
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:
Performance Lab currently opens its own output buffer at
template_redirectand sends theServer-Timingresponse header duringtemplate_include:performance/plugins/performance-lab/includes/server-timing/class-perflab-server-timing.php
Lines 239 to 245 in 8368b58
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 thewp_template_enhancement_output_bufferfilter.Additionally, when output buffering is not desired, the new
wp_before_include_templateaction can be used to send theServer-Timinginstead of using thetemplate_includefilter.See also: