[wp-trac] [WordPress Trac] #43258: Output buffer template rendering and add filter for post-processing (e.g. caching, optimization)

WordPress Trac noreply at wordpress.org
Tue Feb 25 19:37:26 UTC 2025


#43258: Output buffer template rendering and add filter for post-processing (e.g.
caching, optimization)
-------------------------+--------------------------------
 Reporter:  nextendweb   |       Owner:  westonruter
     Type:  enhancement  |      Status:  accepted
 Priority:  normal       |   Milestone:  6.8
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  docs, performance
-------------------------+--------------------------------

Comment (by flixos90):

 Reviewing the Gutenberg implementation in
 https://github.com/WordPress/gutenberg/pull/61212, I wonder whether we can
 do better than just filtering the entire HTML string.

 Especially with the new performant HTML processor (see related comment
 [comment:13]), maybe we should mandate using it, i.e. filter only an
 instance of that class? I think that would actively discourage any of the
 bad patterns we have seen (and done) in the past, like using regex on
 HTML.

 For use-cases that don't ''alter'' the HTML (such as caching plugins), we
 could still expose that string but in a read-only way, such as via a new
 action that is fired as part of the output buffering.

 Long story short: We probably shouldn't go with the quick and simple
 approach of filtering the entire HTML string, but think about something
 that encourages best practices.

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


More information about the wp-trac mailing list