-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Proxito: canonical redirects don't need further inspection of the version/project/filename #10065
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
Comments
@stsewd I think the trade off here is that we end up with multiple requests, instead of a single request. I believe the original implementation was trying to get the user to the right place with 1 HTTP redirect. That said, if we can be smarter here with caching, it would be great, but multiple round trips to the server is also a huge source of slowness for users, and something to consider in design. |
I think 1 HTTP redirect will be harder to implement correctly. Also, once implemented, I suppose the code will be harder to follow as well 😄 |
Yea... looking at the implementation, I really like the simplicity of it, so I think it's likely the correct approach. Just wanting to make sure we're considering the UX when we design it :) |
This is an initial usage of the new proxito implementation to serve files. It's under a feature flag, so it can be enabled per-project. - We still need to adapt our 404 handler to make use of this new implementation (it could be simplified with #10061) - We are still using our re paths to match the URLs, but we don't make use of the captured parameters, we use the unresolver for that. This also means that things like #2292 won't be solved till we do the whole migration. - There is a lot of repetition from the original get method, but some of it could be simplified with #10065. Tests will pass once we have merged one private PR that we have pending. > **Note** > We don't support custom urlconfs yet, so we shouldn't enable it for those projects yet.
Currently, our canonical redirect logic expects to the current project/version/filename
readthedocs.org/readthedocs/proxito/views/serve.py
Lines 148 to 155 in c0c3f02
But in reality, we shouldn't need those, because:
main-project.rtd.io/projects/subproject/{path}
(no need for version or filename!)Moving the execution of the http-https and to-canonical-domain redirects should be easy, moving the other one requires adding a new way of unresolving a project
readthedocs.org/readthedocs/core/resolver.py
Lines 173 to 176 in c0c3f02
this new way will just accept the project and return the root path of it, no versions, no translations, just the root (like it would be a single version), for example:
The text was updated successfully, but these errors were encountered: