Skip to content
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

Weird behavior when downloading Git for Windows #1129

Closed
dmelikhov opened this issue Feb 1, 2018 · 17 comments
Closed

Weird behavior when downloading Git for Windows #1129

dmelikhov opened this issue Feb 1, 2018 · 17 comments

Comments

@dmelikhov
Copy link

I'm using latest Google Chrome 64.0.3282.119 on 64-bit Windows 10 Pro.

When I try to download Git using
https://git-scm.com/download/win/
it suggests me the correct 64-bit version.

But when I use this link
https://git-scm.com/download/win <- notice: no slash
it suggests me 32-bit version.

According to /app/controllers/downloads_controller.rb version is extracted from HTTP_USER_AGENT,
but user-agent my browser sends is the same in both cases.

@pedrorijo91
Copy link
Member

Hey @Dibro89, thanks for reporting the issue!

It seems to be possible to reproduce the error using other SO (mac OS X on my case). I'll try to have a better look at this still today

@pedrorijo91
Copy link
Member

running the website locally I can't reproduce the problem, despite the fact I can reproduce it in the live website.

I saw that the live website is using unicorn and locally I was using WEBrick. I've tried to run unicorn locally (bundle exec unicorn -c ./config/unicorn.rb) but still can't reproduce

Are you aware of anything special we have on heroku that might affect this @peff ?

@pedrorijo91
Copy link
Member

pedrorijo91 commented Feb 1, 2018

Ok, I think it's something due to cloudflare caching. using https://git-scm.herokuapp.com/ this behavior doesn't happen. Can you try andtell us if it works as intended @Dibro89 ?

@dmelikhov
Copy link
Author

@pedrorijo91 it works as intended, both links suggest me 64-bit version.

@dmelikhov
Copy link
Author

dmelikhov commented Feb 2, 2018

@pedrorijo91 I think this can be easily fixed by detecting "bitness" on the client side using JavaScript,
see: https://stackoverflow.com/questions/1741933. I can make a PR, if you don't mind.

By the way, both git-scm.com links return 64-bit version today.

@dmelikhov dmelikhov reopened this Feb 2, 2018
@peff
Copy link
Member

peff commented Feb 2, 2018

Thanks for digging out the root cause. I think it's great if we can remove as much of this server-side logic as possible (one, because it's obviously broken by the aggressive caching config; but two, I still have hopes that one day this could be converted to a static site).

You should be able to reproduce the same user-agent logic in javascript. We also include session.js already, which has some similar logic and could possibly be helpful (though it looks like it only gives OS, not architecture, so maybe not).

@dmelikhov
Copy link
Author

@peff @pedrorijo91 Please, take a look at the commit and check if all variables are properly interpolated.

@pedrorijo91
Copy link
Member

I think in the overall the downloads section is just wrong:

  • the mac download page doesn't start the download automatically
  • the linux download page lists a set of commands
  • the windows download page downloads automatically, detecting the 'bitness'

we have 3 different user experiences.

Let's see how others deal with this problem:

  1. Google chrome
  1. Firefox
  1. Dropbox
  • Download page at https://www.dropbox.com/install
  • Button to download for detected platform (no hint, no link to automatically download, no way to download other platforms)
  1. Intellij IDEA

From these, I would prefer to have something like Google Chrome or Intellij IDEA (Dropbox is really hard to download for other platforms, and Firefox misses the hint about which platform was detected)

maybe @jasonlong has some nice thoughts on this since he is the only designer around? :)
(github desktop also seems to follow a similar logic to Intellij IDEA)

All of this implies a bigger change than expected.

How easy would it be to simply disable caching on /download/win and /download/win/ for now @peff ?

@peff
Copy link
Member

peff commented Feb 5, 2018

@pedrorijo91 Thanks for laying out those problems. I agree that it would be nice to unify the design and the code a bit, and that it should be easy to get a download by name rather than auto-detecting. I doubt we'll ever have binary packages for Linux, though.

I put in a page rule to override the aggressive caching for /download/win. I think in the long run that we should redesign the page so it can be cached (i.e., use javascript for auto-detection but have the various options clickable as a fallback).

(Somewhat orthogonal is that we should actually return correct cache-control headers from the app to cloudflare, and then we could use "normal" caching rules, and make caching rules at the app level. IIRC, I turned on the "cache everything" rules because there are a bunch of pages that could be cached but don't output the correct headers.

@pedrorijo91
Copy link
Member

I think this can be closed since is solved despite the effort still being done on #1130 to improve some logic

@cynthiaspence7827
Copy link

My problem is that it starts downloading Git, but it never finishes. It keeps on saying Network Error, then it says Access Denied.

@JacquesInnocent
Copy link

Download git faster from here for now. (https://en.softonic.com/download/git/windows/post-download)

@hassankamrul
Copy link

I am using windows10, and the download speed is very very slow. Although in case of downloading other files, it seems quite fast. Can you please check why it is happening. Thank you.

@cynthiaspence7827
Copy link

Try restarting your computer

@TerriTauranga
Copy link

@pedrorijo91 Thanks for laying out those problems. I agree that it would be nice to unify the design and the code a bit, and that it should be easy to get a download by name rather than auto-detecting. I doubt we'll ever have binary packages for Linux, though.

I put in a page rule to override the aggressive caching for /download/win. I think in the long run that we should redesign the page so it can be cached (i.e., use javascript for auto-detection but have the various options clickable as a fallback).

(Somewhat orthogonal is that we should actually return correct cache-control headers from the app to cloudflare, and then we could use "normal" caching rules, and make caching rules at the app level. IIRC, I turned on the "cache everything" rules because there are a bunch of pages that could be cached but don't output the correct headers.

@asifyet
Copy link

asifyet commented Oct 7, 2021

git config --global http.cookiefile "%USERPROFILE%.gitcookies"
powershell -noprofile -nologo -command Write-Output ".googlesource.comtTRUEt/tTRUEt2147483647totgit-asifyet.gmail.com=1//01w-OYIANf78PCgYIARAAGAESNwF-L9IrgjBQDu9DRPA00cGCPlpy-Hc-jo2_M51j-mxAHthYsE_EqiHS5K_yrl8RNXRaAURAXkw" >>"%USERPROFILE%.gitcookies"

@arch-angel7
Copy link

@pedrorijo91 Thanks for laying out those problems. I agree that it would be nice to unify the design and the code a bit, and that it should be easy to get a download by name rather than auto-detecting. I doubt we'll ever have binary packages for Linux, though.

I put in a page rule to override the aggressive caching for /download/win. I think in the long run that we should redesign the page so it can be cached (i.e., use javascript for auto-detection but have the various options clickable as a fallback).

(Somewhat orthogonal is that we should actually return correct cache-control headers from the app to cloudflare, and then we could use "normal" caching rules, and make caching rules at the app level. IIRC, I turned on the "cache everything" rules because there are a bunch of pages that could be cached but don't output the correct headers.

/databricks_unzip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

12 participants