-
Notifications
You must be signed in to change notification settings - Fork 394
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
man.dvc.org/import-url redirect is broken #768
Comments
That is funny. Probably a bug in the redirect code... |
other misc. noted on existing redirects Fixes #768
This is still broken after attempting a hotfix. In fact now man.dvc.org/get-url is also broken! Which is weird because I tested the logic in server.js and it works well locally. Here's the latest prod deploy diff: 37aab6a...a07bd0c#diff-78c12f5adc1848d13b1c6f07055d996eL37-R37 for this code: Lines 34 to 42 in a07bd0c
However on prod everything gets replaced, even when |
hotfix: rewrite man.dvc.org redirect logic without ternary op to see if it fixes #768
This comment has been minimized.
This comment has been minimized.
There's 2 things going on here ^ BTW:
We could separate each one for even further clarity, but that would result in an extra redirect. |
Related: #757 |
I think the reason it does not work for me is caching of redirects:
If I run it a private windows everything works fine. So, we should check if there is a way to manage cache lifetime for redirects. |
I guess this is the issue we bumped into! 301 Redirects: The Horror That Cannot Be Uncached Basically you can only do a 301 redirect once... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Right, that's an example of a permanent one, from man.dvc.org to dvc.org/doc/command-reference But it used to turn
What do you think?
I guess in this case we can indeed ignore it. I doubt many people have used man.dvc.org/import-url or /get-url and definitely no search engines since man.dvc.org URLs are only printed in our command line. 🙂 (I think) |
there are probably some links outside, not many indeed
sounds too complicated to be honest. Let's first see what we can with Almost all our redirects are permanent in nature, I actually don't see a good example of 302. |
Well, let's see our current redirects in server.js:
Seems like you're right! Only the
But OK! Let's try this first... |
it's also permanent, I think. We don't plan to change it back right? It's temporary in a sense that we will remove it completely soon and start returning 404. Tbh, would not worry that much about redirects like
need to be careful with this - I don't know anything about 30x, x>2. :) |
OK I added
302 (Found (Previously "Moved temporarily")) has been superseded by 303 and 307. Seems to me 307 is exactly what we want during a period of backward compatibility with certain man.dvc.org/cmd-subcmd URL paths that used to need converting From https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection |
yep, I just don't know how well all these codes are supported that's why a bit cautious |
OK so now that #772 is merged, I opened an incognito window in Chrome and went to https://man.dvc.org/import-url, then tried again. Both times I see this same Network response: General Request URL: https://man.dvc.org/cache-dir Response Headers
No more
|
Alright, seems like this is fixed now even for previous clients. Having a I still think we should use 307 for some or all the backward compatibility redirects (see #768 (comment)) but OK, will address this later in #757. |
@jorgeorpinel I don't think it's fixed unfortunately. I think Firefox at least does not respect the flag. |
Boo FF. Happily it has like 5% of the market. https://en.wikipedia.org/wiki/Usage_share_of_web_browsers#Summary_tables Safari is more relevant, but I can't tell whether it respects the cache-directive. |
It's 11% for dvc.org, the same as Safari :) |
So should we separate the 301 redirect from man.dvc.org to /doc/cmd-ref from a new 302 or 307 redirect that replaces |
almost all of them (except import-url and get-url)
let's not do this. Not that we understand that it's only caching issue, I think we can keep 301s. Most of our users will see the right result. When we get to the #757 we can think one more time about what codes we apply where - most likely most of them will be 301s anyway to keep SEO. let's close this for now? good findings and good research for 757. |
Sounds like a plan.
We'll see haha 🙈
Sure! You reopened it so I was just thinking out-loud what alternatives we had left. Closing! 🙂 |
It supposed to behave in the same way as
man.dvc.org/get-url
The fix should be applies to the server.js file.
The text was updated successfully, but these errors were encountered: