You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your enhancement related to a problem? Please describe.
We recently did some work to reduce the Yoast payload and optimize hydration but there's still room for improving performance by preventing Yoast from doing a lot of additional queries on WP by disabling these additional queries in the Plugin.
We don't need every post to have an associated yoast_head and yoast_head_json. We only need the first post and the associated queried object to have Yoast metadata.
Bellow are examples of different scenarios and which entities would need the yoast metadata.
Scenarios
Scenario 1
If we're querying for { postType: 'post', slug: 'hello-world' }. Only the first post needs Yoast metadata, There's no queriedObjected on this request so metadata on associated terms can be removed as well.
Scenario 2
If we're querying for { postType: 'post', per_page: 10, category: 'news' }, only the first post and the first term of the news category needs the yoast metadata.
Scenario 3
If we're querying for { postType: 'post', per_page: 10, author: 'jane' }, only the first post and the jane author needs the yoast metadata.
Scenario 4
If we're querying for { postType: 'post', per_page: 10, category: 'news', author: 'jane' }, only the first post. the jane author needs the first term of the news category needs the yoast metadata.
Implementation
We can activate this optimization via headless.config.js.
Then if optimizeYoastPayload is true our fetch strategies would send a optimizeYoastPayload query param to all requests which would enable the plugin code to optimize yoast metadata. This allows the optimization to be controlled by the front-end versus having to activate via a filter/setting in WP.
Designs
No response
Describe alternatives you've considered
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Is your enhancement related to a problem? Please describe.
We recently did some work to reduce the Yoast payload and optimize hydration but there's still room for improving performance by preventing Yoast from doing a lot of additional queries on WP by disabling these additional queries in the Plugin.
We don't need every post to have an associated
yoast_head
andyoast_head_json
. We only need the first post and the associated queried object to have Yoast metadata.Bellow are examples of different scenarios and which entities would need the yoast metadata.
Scenarios
Scenario 1
If we're querying for
{ postType: 'post', slug: 'hello-world' }
. Only the first post needs Yoast metadata, There's no queriedObjected on this request so metadata on associated terms can be removed as well.Scenario 2
If we're querying for
{ postType: 'post', per_page: 10, category: 'news' }
, only the first post and the first term of thenews
category needs the yoast metadata.Scenario 3
If we're querying for
{ postType: 'post', per_page: 10, author: 'jane' }
, only the first post and the jane author needs the yoast metadata.Scenario 4
If we're querying for
{ postType: 'post', per_page: 10, category: 'news', author: 'jane' }
, only the first post. the jane author needs the first term of thenews
category needs the yoast metadata.Implementation
We can activate this optimization via
headless.config.js
.Then if
optimizeYoastPayload
is true our fetch strategies would send aoptimizeYoastPayload
query param to all requests which would enable the plugin code to optimize yoast metadata. This allows the optimization to be controlled by the front-end versus having to activate via a filter/setting in WP.Designs
No response
Describe alternatives you've considered
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: