Only poll data for environments folder if it's open
If you open https://gitlab.com/gitlab-org/gitlab/-/environments with the networks tab, you see that we constantly poll review
and review-docs
:
This creates a lot of unnecessary load on the server:
We poll folder.json
2-7 times more often than index.json
. This means that every user with the open /environments
page:
- constantly requests environments updates
- constantly requests updates for every folder on the page(on average 2-7 folders per page)
This is very inefficient if user doesn't even open the folder, we constantly refreshing the data which isn't shown anywhere.
It accounts for 30-40
unnecessary rps
on gitlab.com and also makes browser to do unnecessary work.
Proposal
Only request folder data when users open the folder, and then only refresh it while the folder is open.