Skip to content

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

  1. Navigate to the on-demand scans index page at /:namespace/:project/-/on_demand_scans.
  2. Open the developer tools and select the Network tab.
    • All requests should get a 304 response.
  3. 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).
  4. In the initial window, switch to a new browser tab.
    • In the developer tools, you should notice that no more requests are being triggered.
  5. 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.

Related to #349988 (closed)

Merge request reports