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

Use fetch API "priority" option to optimize UI blocking requests #5718

Closed
akhenry opened this issue Aug 26, 2022 · 2 comments · Fixed by #5737
Closed

Use fetch API "priority" option to optimize UI blocking requests #5718

akhenry opened this issue Aug 26, 2022 · 2 comments · Fixed by #5737

Comments

@akhenry
Copy link
Contributor

akhenry commented Aug 26, 2022

Is your feature request related to a problem? Please describe.
Some requests to server resources are expected to take a long time (eg. requests for historical telemetry, large image downloads, etc) and need not block the UI. Other requests (such as requests for domain objects) should be relatively quick, and do block the UI. As such we should prioritize quick, UI blocking requests above slower non-blocking ones.

Describe the solution you'd like
Some browsers (eg. Chrome and Edge) support a priority option that allows code to provided hints about how to prioritize requests. We should use this to prioritize requests to Couch DB above requests to Yamcs by setting the priority to high. I will create a corresponding issue in the openmct-yamcs repo to set the priority to low.

I believe non-supporting browsers will just ignore the option (have tested with Firefox, and it did not throw an error) so no browser detection is necessary.

@akhenry akhenry self-assigned this Sep 7, 2022
@akhenry akhenry mentioned this issue Sep 7, 2022
15 tasks
@akhenry
Copy link
Contributor Author

akhenry commented Sep 7, 2022

Testing instructions

Before Each :)

  1. Open the Chrome Dev Tools
  2. Switch to the network tab
  3. Right click on any of the columns and select "Priority" to add the priority column

Test that image requests are assigned lower priority

  1. Navigate to the imagery view
  2. Verify that the request for the image itself has a priority of "low" in the priority column of the network tab

Test that requests for couch objects are assigned high priority

  1. Navigate around between several domain objects
  2. Verify that requests for domain objects from Couch DB are given a priority of "high"

@khalidadil
Copy link
Contributor

Verified Fixed in Testathon on 09/15/22. This seems to be working as expected in the imagery view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants