[wp-trac] [WordPress Trac] #64126: Sending late HTTP headers not facilitated by template enhancement output buffer

WordPress Trac noreply at wordpress.org
Sat Oct 25 04:29:41 UTC 2025


#64126: Sending late HTTP headers not facilitated by template enhancement output
buffer
--------------------------------------+--------------------------
 Reporter:  westonruter               |       Owner:  westonruter
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  6.9
Component:  General                   |     Version:  trunk
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+--------------------------
Changes (by westonruter):

 * keywords:  has-patch => has-patch has-unit-tests


Comment:

 In [https://github.com/WordPress/wordpress-develop/pull/10381 PR #10381]:

 * Introduce `wp_send_late_headers` action which fires right right after
 `wp_template_enhancement_output_buffer` filters have applied, and right
 before the output buffer is flushed. The output buffer is passed as an
 argument to the function so that plugins may do things like send an `ETag`
 header calculated from the content.
 * The template enhancement output buffer now is enabled by default if
 _either_ there is a `wp_template_enhancement_output_buffer` filter added
 _or_ there is a `wp_send_late_headers` action added.
 * The `wp_start_template_enhancement_output_buffer()` callback for the
 `wp_before_include_template` action is increased from the default 10 to
 1000. This goes with the previous point, so that plugins can add those
 filters and actions during the `wp_before_include_template` action without
 having to worry about adding them too late, that is, after
 `wp_start_template_enhancement_output_buffer()` has run.
 * The `wp_send_late_headers` action fires regardless of whether the
 buffered response is HTML.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64126#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list