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

github.com vs codeload.github.com downloads #65

Closed
barryvdh opened this issue Mar 3, 2016 · 2 comments
Closed

github.com vs codeload.github.com downloads #65

barryvdh opened this issue Mar 3, 2016 · 2 comments
Labels

Comments

@barryvdh
Copy link

barryvdh commented Mar 3, 2016

I see you convert the Github API to a codeload url. Is that to prevent API rate limits or just an unneeded redirect? Wouldn't it be more reliable to use the github.com direct download link instead? Like in composer/composer#4737 ?

if (isset($urls[0]) && preg_match('#^https://api\.github\.com/repos/([^/]++/[^/]++)/zipball/(.++)$#', $urls[0], $match) && !$this->io->hasAuthentication('github.com')) {
            array_unshift($urls, 'https://github.com/'.$match[1].'/archive/'.$match[2].'.zip');
            $processUrl = false;
        }
@hirak
Copy link
Owner

hirak commented Mar 6, 2016

Because it doesn't need to redirect. It's a secondary effect that prestissimo reduces API requests.

Redirect + HTTPS is TERRIBLE slow. So I reduced redirects.
For speed, it's no sense to download directly from https://github.com . It still occures one redirect.

https://github.com/hirak/prestissimo/archive/1fdeea0d6b899cfe158bda86ea11bb625685ad15.zip
↓ redirect
https://codeload.github.com/hirak/prestissimo/zip/1fdeea0d6b899cfe158bda86ea11bb625685ad15
https://api.github.com/repos/hirak/prestissimo/zipball/1fdeea0d6b899cfe158bda86ea11bb625685ad15
↓ redirect
https://codeload.github.com/hirak/prestissimo/legacy.zip/1fdeea0d6b899cfe158bda86ea11bb625685ad15

@hirak
Copy link
Owner

hirak commented Apr 9, 2016

Have you solved the problem ? If you find any question, please re-open.

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

No branches or pull requests

2 participants