OneGet / MicrosoftDockerProvider

Provider to search, save and install Docker
Other
135 stars 56 forks source link

Use HEAD HTTP request to avoid downloading file twice #63

Closed StefanScherer closed 4 years ago

StefanScherer commented 4 years ago

I've tested the DockerMsftProvider in a VM with a simulated slow network connection and could reproduce the problem that the ZIP file isn't downloaded. Looking closer it turns out that retrieving the download size is the problem. This has downloaded the whole zip file and then we retrieved the size. This PR does a HEAD request to just retrieve the header and not the whole file.

install-package-docker-with-pr-fix

With the simulated 4MBit connection the download takes about 6-8 minutes and Invoke-WebRequest does a good job.

Fixes #15 Fixes MicrosoftDocs/Virtualization-Documentation#919

Credits: Thanks @InteXX for showing me https://github.com/OneGet/MicrosoftDockerProvider/issues/15#issuecomment-310871007 which helped me to find the root cause of the problem.

cwilhit commented 4 years ago

LGTM. Thanks!