First, I notice the start script in patient-management is misconfigured (it currently runs openmrs develop --sources 'packages/esm-*-app' which means that its starting 7 Webpack dev servers. Fixing that will presumably help quite a bit—actually, this is far and away the single thing I think will make the biggest difference.
Second, when I go to dev3, I see we are almost immediately making 6 requests (1 per identifier type) to https://dev3.openmrs.org/openmrs/ws/rest/v1/idgen/autogenerationoption?v=full, which seems redundant since there’s no parameter that varies by identifier type. Subsequently, if I actually open the registration app, I see 6 more requests to that same endpoint. From the speeds you’re showing, reducing that to one call should shave about 6 seconds off the total request time.
Third, there’s a request-per-identifier-type to the /openmrs/ws/rest/v1/idgen/identifiersource endpoint, which makes sense; however, the only non-empty response for those requests is the one for the single identifier returned from the autogenerationoption endpoint… Could we maybe leverage that to reduce the number of calls we need to make to those endpoints? (I also see these requests loaded initially and then re-done if I open the registration app, which is also duplicate work we probably don’t need to do).
Reducing the number of calls we’re making should speed things up since there’s less request blocking and also less work for the local proxies to do…
(I also see these requests loaded initially and then re-done if I open the registration app, which is also duplicate work we probably don’t need to do).
Yes Ian, I’ll look into this too. Actually the first request is being made by the offline-tools, and the second requests that you see are the one made by SWRImmutable (here), calling the same functions.
Oh… I see… so there’s a pre-caching stage I guess we’ll have to somehow retain that. Maybe a slightly different design then: can we use the current offline flow but push the values into the SWR cache using the mutate function (assuming SWR 2.0)?