getEntityRecords performance issues
-
There is a sever performance issue associated with using getEntityRecords in that triggers the content of the entire website to be downloaded as a response.
Is it possible to specify the fields to be returned when making the getEntityRecords? As things stand, the following code results in the content and excerpts of every page being downloaded including the processing of all shortcodes.
edit: withSelect( ( select, props ) => { PROPS=props; return { posts: select( 'core' ).getEntityRecords( 'postType', 'page', {per_page:-1, order:'asc', orderby:'title'} ), };
Are there filters I can set on the server to control what fields are returned? It appears Gutenberg editor is always generating a REST API request of the form “wp-json/wp/v2/pages?per_page=100&exclude=<page>&parent_exclude=<page>&orderby=menu_order&order=asc&context=edit&_locale=user”
Finally, I am not sure of the rationale of including all page content by default when just requesting a list of pages, I would have expected there should be an mechanism to specify the fields to be returned when making the getEntityRecords requests. In making this observation I am aware that this will affect both the Gutenberg Block Editor functionality and WordPress REST API.
The page I need help with: [log in to see the link]
- The topic ‘getEntityRecords performance issues’ is closed to new replies.