Improve on-demand scans polling performances
What does this MR do and why?
This reduces the GraphQL polling overhead in the on-demand scans page by...
- ...including an ETag header in the query to prevent hitting the database on every request.
- ...putting the query behind a visibility check to pause the polling when the browser tab is not visible.
- ...increasing the polling interval from 1 to 3 seconds.
How to set up and validate locally
- Navigate to the on-demand scans index page at
/:namespace/:project/-/on_demand_scans
. - Open the developer tools and select the
Network
tab.- All requests should get a
304
response.
- All requests should get a
- In another window, create a new DAST scan (click on
New DAST scan
in the on-demand scans index page).- In the previously opened developer tools, you should get two
200
responses (on is for pipeline counts, the other is for pipelines themselves).
- In the previously opened developer tools, you should get two
- In the initial window, switch to a new browser tab.
- In the developer tools, you should notice that no more requests are being triggered.
- Switch back to the initial browser tab.
- In the developer tools, requests should resume.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #349988 (closed)