[wp-trac] [WordPress Trac] #45471: Allow caching of parse_blocks results

WordPress Trac noreply at wordpress.org
Mon Dec 3 12:08:15 UTC 2018


#45471: Allow caching of parse_blocks results
-------------------------+------------------------------------
 Reporter:  joostdevalk  |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Cache API    |    Version:
 Severity:  normal       |   Keywords:  has-patch dev-feedback
  Focuses:  performance  |
-------------------------+------------------------------------
 A *lot* of Gutenberg implementations are going to have to parse the blocks
 in a post. Core itself already parses the blocks on output, but also when
 trimming an excerpt in `excerpt_remove_blocks`. All this parsing is done
 with `parse_blocks`. Unfortunately, the only thing passed to
 `parse_blocks` right now is a string, with no way of caching it.

 My suggestion would be to add a cache key to the `parse_blocks` function,
 which defaults to false. I've attached a proposed patch to the function,
 if we agree on this we could then look at how to implement this in core
 itself.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45471>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list