Roadmap items 14, 15, 16, 19 (P2). Grouped: one caching/fetching pass over the remote News path. 14 and 16 are verified.
The News block is the only block that fetches over REST from the news site (News_Request, base URL chosen from wp_get_environment_type()). Its fetch path currently has four compounding problems.
Roadmap item 14 — N+1 blocking HTTP on cold render
One wp_remote_get per featured image plus one per coauthor, on top of the posts request itself — up to ~19 sequential blocking calls to render a 9-post block with a cold cache.
Fix: request _embed on the posts request so media and author data arrive in one response; drop the per-object follow-up calls.
📍 src/Components/News_Block_Controller.php:132-190
Roadmap item 15 — No timeout on any remote request
Every wp_remote_get uses the 5s default. Combined with 14, a slow or unreachable news host can stall a front-end page render for tens of seconds.
Fix: set an explicit short timeout (2–3s), and make a failed fetch degrade to an empty/cached result rather than blocking.
📍 src/Request/News_Request.php:17
Roadmap item 16 — Cache keys embed taxonomy_ids
Media and coauthor transients are keyed with the block's taxonomy_ids, so the same attachment or author is cached separately for every block configuration that references it. Cache hit rate collapses; transient table grows.
Fix: key per-object caches by object ID only. Keep the taxonomy-scoped key for the posts query result, where it belongs.
📍 src/Components/News_Block_Controller.php:125-130
Roadmap item 19 — Unbounded pagination recursion
News_Request::request() recurses over paginated results with no page cap. A large X-WP-TotalPages means unbounded sequential fetches on a single render.
Fix: cap the page count (and/or stop once enough posts for the block have been collected).
📍 src/Request/News_Request.php:30-40
Acceptance
Roadmap items 14, 15, 16, 19 (P2). Grouped: one caching/fetching pass over the remote News path. 14 and 16 are verified.
The News block is the only block that fetches over REST from the news site (
News_Request, base URL chosen fromwp_get_environment_type()). Its fetch path currently has four compounding problems.Roadmap item 14 — N+1 blocking HTTP on cold render
One
wp_remote_getper featured image plus one per coauthor, on top of the posts request itself — up to ~19 sequential blocking calls to render a 9-post block with a cold cache.Fix: request
_embedon the posts request so media and author data arrive in one response; drop the per-object follow-up calls.📍 src/Components/News_Block_Controller.php:132-190
Roadmap item 15 — No
timeouton any remote requestEvery
wp_remote_getuses the 5s default. Combined with 14, a slow or unreachable news host can stall a front-end page render for tens of seconds.Fix: set an explicit short timeout (2–3s), and make a failed fetch degrade to an empty/cached result rather than blocking.
📍 src/Request/News_Request.php:17
Roadmap item 16 — Cache keys embed
taxonomy_idsMedia and coauthor transients are keyed with the block's
taxonomy_ids, so the same attachment or author is cached separately for every block configuration that references it. Cache hit rate collapses; transient table grows.Fix: key per-object caches by object ID only. Keep the taxonomy-scoped key for the posts query result, where it belongs.
📍 src/Components/News_Block_Controller.php:125-130
Roadmap item 19 — Unbounded pagination recursion
News_Request::request()recurses over paginated results with no page cap. A largeX-WP-TotalPagesmeans unbounded sequential fetches on a single render.Fix: cap the page count (and/or stop once enough posts for the block have been collected).
📍 src/Request/News_Request.php:30-40
Acceptance