-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve URL resolver performance #3712
Comments
Hi @davidfischer, Can I take up this issue. |
That's pretty accurate. I'm not 100% sure that we should force HTTPS yet (see #3282). While every project hosted by |
I should mention that I welcome a PR for this. However, I will caution you that this will probably be a bit complex. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Our URL resolver (https://github.com/rtfd/readthedocs.org/blob/4d10f2e/readthedocs/core/resolver.py) which turns a
Project
and/orVersion
into a URL to their documentation needs some performance improvements to reduce or eliminate the number of database queries it makes.This is particularly noticeable on the
footer_html
API call (https://github.com/rtfd/readthedocs.org/blob/ba71aa1/readthedocs/restapi/templates/restapi/footer.html#L43) which is called on every docs pageview to inject the version selector. In order to get the URL to each version in the version selector, four database queries are needed (to make sure this isn't a subproject or translation and get the domain). So for a project with 10 active versions, we are looking at 40 database queries. Most of this effort is wasted since the data is only needed once for the project.The text was updated successfully, but these errors were encountered: