[wp-trac] [WordPress Trac] #50245: extend functionality to stop further actions on hook on a priority range

WordPress Trac noreply at wordpress.org
Tue May 26 08:49:39 UTC 2020


#50245: extend functionality to stop further actions on hook on a priority range
-------------------------+--------------------------
 Reporter:  Alignak      |       Owner:  (none)
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  Cache API    |     Version:
 Severity:  normal       |  Resolution:  invalid
 Keywords:               |     Focuses:  performance
-------------------------+--------------------------

Comment (by Alignak):

 Replying to [comment:4 apedog]:

 Thank you very much.

 I am a programmer for 10 years and I always have to deal with poor code
 standards from multiple developers.

 Query Monitor, Object Cache, debug_backtrace, etc... I know how to use it.
 What I am missing (always too busy) is to spend a week getting more
 familiar with wordpress core and avoid not knowing about such useful
 information as the one you posted.

 In my field I need to micro manage certain things, because I do both
 performance audits and server stuff.

 Frequently, I see sites from clients that use fancy editors and then the
 page loads like 3 MB worth of shortcodes, which on some servers take a
 while to generate and cause a TTFB to go over 3, 4, 5 seconds.

 One of my ideas was to cache the_content (often the slowest part of the
 page) on redis, (I said transient early for the sake of simplicity
 explaining the concept) and completely bypass the rebuilding process by
 serving it from cache when available.

 Obviously it won't work for all possible case scenarios, but for some
 cases it will and it will speed things up dramatically.

 I tried the function you posted and it did what I want to do, however one
 must be careful not to return anything after removing the filters, else
 the filters still run (according to wp profile) if I return
 {{{$content}}} on other condition.

 But your answer definitely put me in the right path for what I am trying
 to achieve and I am very thankful.

 Thanks again

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


More information about the wp-trac mailing list