Use eTags for new MR widget polling endpoint?
MergeRequestsController#merge_check
proved to be a resource consuming endpoint on production.
Basically, it's used for real-time updating the MR widget and it's polled every 10 seconds
.
The main drawback for eTag caching on this endpoint is how broad the data changes can be made on the codebase:
See https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/serializers/merge_request_entity.rb
Would like to bring up that we've dropped ci_status
endpoint and also moved this data to merge_check
endpoint (i.e. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/serializers/merge_request_entity.rb#L33), so there's only one endpoint responsible for the MR widget data flow (despite Approvals and Deployments).
That being said, I would like to discuss an approach for tackling this particular performance improvement.
A few options:
- Invalidate the eTag cache on every possible place
- Check the pain-points and focus on caching that particular data
cc @yorickpeterse @ayufan @adamniedzielski
EDIT: We're now using just /show.json
endpoint - /merge_check
got removed