Improve performance accessing large repositories
Large repos take a long time to loop or count branches leading to 502s. The issue is solved once this content is cached (for instance, after we profile the page without the request timeout limitation, we'll be able to access the project page).
This issue affects the main project page, but also other pages such as the branch or tag list.
Once we profile a page we'll have to run:
project.repository.expire_content_cache
in order to replicate the problem.
Profiling output of the main project page: https://gitlab.slack.com/files/jameslopez/F677022KT/prof.1.html
Edited by James Lopez