[wp-trac] [WordPress Trac] #27538: Widget Customizer: Persistent object cache causes certain previewed widgets to leak outside of customizer

WordPress Trac noreply at wordpress.org
Thu Mar 27 00:23:20 UTC 2014


#27538: Widget Customizer: Persistent object cache causes certain previewed widgets
to leak outside of customizer
--------------------------+--------------------
 Reporter:  westonruter   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.9
Component:  Widgets       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+--------------------
Changes (by westonruter):

 * keywords:   => has-patch


Comment:

 Perhaps there should be a couple helper abstractions added to `WP_Widget`
 to encourage proper caching and to reduce redundancy. The `WP_Widget`
 constructor could accept the cache key as one of the arguments, and if it
 is provided, then before `widget()` is even called it could short-circuit
 with the cached output if it was supplied. Otherwise, it would start
 output buffering and then after `widget()` returns it could store the
 cached output and flush so that the next time the widget is to be
 rendered, the cached output could be served. When calling `update()` the
 supplied object cache key could be automatically flushed. All of this
 caching could be prevented if being run inside of the customizer.

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


More information about the wp-trac mailing list