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
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.
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.
The text was updated successfully, but these errors were encountered:
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!
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.
Dev notes:
/__experimental/menus/<currentMenuId>
calls./__experimental/menus/
endpoint anyway.The text was updated successfully, but these errors were encountered: