WordPress / WordPress/performance
Leverage template enhancement output buffer for Server Timing in WP 6.9
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 461
- Forks
- 165
- Avg merge
- 11h 12m
- Merged PRs (30d)
- 28
Description
Performance Lab currently opens its own output buffer at template_redirect and sends the Server-Timing response header during template_include:
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:
- #2224
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in plugins/performance-lab/includes/server-timing/class-perflab-server-timing.php at the template_redirect and template_include handling, then review Core-43258 and changeset r60936 for the new WordPress hooks. Use the available function and hooks conditionally for WordPress 6.9, while preserving the existing behavior when they are unavailable. Done means Server-Timing is sent correctly with and without output buffering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100