-
Notifications
You must be signed in to change notification settings - Fork 19
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
It takes a long time to make the first request #38
Comments
Try
When you make a first HTTP2 request, it may use additional time to set up the HTTP2 session. Further requests should be faster. |
Is there any fix for this? Facebook.com takes 60s for the first request.
|
I'm working on it right now |
Indeed. Fixed a few bugs, and for |
Sometimes it gives the proper result, sometimes it waits 60s... |
Nope. http2wrapper.request('https://facebook.com', () => {
console.log('got response');
}).end(); this works as expected... but it doesn't work with Got for some reason... |
It has to do something with redirects or HTTP2 origins. If you add |
No. If you query |
Hmmm. http2wrapper.request('https://www.facebook.com', () => {
console.log('got response');
}).end(); works as expected Edit: request('https://www.facebook.com', response => {
response.resume();
response.once('end', () => {
console.log('got end');
});
}).end(); shows it's a bug in Got. But I'm still not sure. |
maybe |
|
Testing on |
you can maybe try other popular sites and see if the same issue is happening with any of them. might help in filtering out the issue with compression |
request('https://www.facebook.com', {
headers: {
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36',
'accept-encoding': 'gzip, deflate, br'
}
}, response => {
response.resume();
response.on('data', chunk => {
console.log(chunk.toString().length);
});
response.once('end', () => {
console.log('got end');
});
}).end(); It's a |
Either it's a bug in Node.js, nghttp2 (the underlying HTTP2 implementation) or in Facebook itself: const {connect} = require('http2');
const session = connect('https://www.facebook.com');
session.once('remoteSettings', () => {
console.log('got settings');
session.request({
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36',
'accept-encoding': 'gzip, deflate, br'
}).once('response', () => {
console.log('got headers');
}).on('data', chunk => {
console.log(chunk.toString().length);
}).on('end', () => {
console.log('got end');
}).resume();
}); |
It's a bug in Facebook, if you remove |
It may be also a bug in Node.js, I need to check that. |
could this be an issue in proxygen? https://engineering.fb.com/production-engineering/introducing-proxygen-facebook-s-c-http-framework/
|
that's what I'm sending too |
It's a Node.js bug, |
Please see the issue above. I'll release a new beta right now. |
Released |
With got v11:
Not sure what's causing it. Pages are speedy when I load them in Chrome.
The text was updated successfully, but these errors were encountered: