Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data: Consider optimizing aggregate of _fields requests #15114

Closed
aduth opened this issue Apr 22, 2019 · 0 comments · Fixed by #19498
Closed

Data: Consider optimizing aggregate of _fields requests #15114

aduth opened this issue Apr 22, 2019 · 0 comments · Fixed by #19498
Labels
[Package] Core data /packages/core-data REST API Interaction Related to REST API [Type] Enhancement A suggestion for improvement. [Type] Performance Related to performance efforts

Comments

@aduth
Copy link
Member

aduth commented Apr 22, 2019

Previously: #12930

In an assumed scenario where two data consumers each fetch an entity (or entity set) while providing _fields, it should be considered whether previous requests could be used to satisfy the requirements.

For example, the following should only require a single network request:

wp.data.select( 'core' ).getEntityRecords( 'postType', 'post', { _fields: [ 'title', 'content' ] } );
wp.data.select( 'core' ).getEntityRecords( 'postType', 'post', { _fields: [ 'title' ] } );

Related:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Core data /packages/core-data REST API Interaction Related to REST API [Type] Enhancement A suggestion for improvement. [Type] Performance Related to performance efforts
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant