[wp-trac] [WordPress Trac] #45471: Allow caching of parse_blocks results
WordPress Trac
noreply at wordpress.org
Wed Mar 29 14:48:39 UTC 2023
#45471: Allow caching of parse_blocks results
--------------------------+-----------------------------
Reporter: joostdevalk | Owner: francina
Type: enhancement | Status: assigned
Priority: normal | Milestone: Future Release
Component: Cache API | Version: 5.0
Severity: normal | Resolution:
Keywords: dev-feedback | Focuses: performance
--------------------------+-----------------------------
Comment (by spacedmonkey):
I am not sure how this work. With dynamic blocks and a number of filters
with blocks, I can't see how it would be cached. How would cache
invalidation work? What if you have a block that access data from the
database, like latest posts or something and that changes.
If we are going to explore this, I would recommend the following path.
Filter `block_parser_class` and override `WP_Block_Parser` class.
Create your own class that extends `WP_Block_Parser` and add caching
there.
This way you can explore options in a feature plugin before anything gets
to core. A feature plugin would need until tests that validate cache
invalidation.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45471#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list