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

Navigation Editor page makes duplicate REST API requests #35601

Closed
3 tasks
anton-vlasenko opened this issue Oct 13, 2021 · 1 comment
Closed
3 tasks

Navigation Editor page makes duplicate REST API requests #35601

anton-vlasenko opened this issue Oct 13, 2021 · 1 comment
Labels
[Type] Performance Related to performance efforts

Comments

@anton-vlasenko
Copy link
Contributor

anton-vlasenko commented Oct 13, 2021

What problem does this address?

For some reason, the Navigation Editor page makes duplicate REST API requests.
Please see the screenshot below.
The first time this request gets served from the cache (see createMenuPreloadingMiddleware middleware once #35402 is merged).
The second time that page makes the same request.
It cannot be served from the middleware to avoid stale data, so the actual REST API request is made.

What is your proposed solution?

There could be multiple solutions.
Investigate why we make the same request twice and fix that (that's the preferred solution)
OR
implement caching for getEntityRecords method, as both requests come from that place. That cache has to take into account that the data may get changed, and we need to implement some Redux store to track the changes. But this doesn't solve all the issues because multiple WordPress admins can change menu entities simultaneously.
Screenshot 2021-10-13 at 18 22 06

Dev notes:

  • Investigate why we make duplicate /__experimental/menus/<currentMenuId> calls.
  • Investigate if we can get rid of these calls. We have all the needed data because we call /__experimental/menus/ endpoint anyway.
  • If it's impossible to get rid of these calls, investigate the possibility to implement caching inside the getEntityRecords method and implement it if it's technically possible.
@kathrynwp
Copy link

Closing this issue due to the Navigation Screen project being moved to an inactive status on the feature projects page in coordination with the project leads. (The developer documentation in the initial post are no longer accessible)

If this work is picked back up, issues can be revisited and reopened as needed. Thanks for pitching in on this early feature so the wider WordPress project could benefit from the lessons learned!

@kathrynwp kathrynwp closed this as not planned Won't fix, can't repro, duplicate, stale Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Performance Related to performance efforts
Projects
None yet
Development

No branches or pull requests

2 participants