Comments (14)
Possibly an edge case not worth fixing... I think this mostly happens with very old servers.
from undici.
I mean we could just explicitly state in the README that persistent connection and pipelining must be supported by the target host. Is that good enough?
from undici.
Yup. What happens otherwise? Does it throw when there already requests queued?
Everything inflight fails except for the first request. So with pipelining=1, every other request would fail (if the queue is full).
from undici.
How would the server communicate that back to the client?
from undici.
The server may send a "Connection: Close" header after the first request is sent indicating it does not want to use a persistent connection.
from undici.
So basically the logic here would be that the client does not pipeline until the first request has succeeded with a persistent connection in order to indicate that the server seems to support pipelining.
from undici.
That would be nice. However I fear it's a lot of complexity.
How are other clients doing it, if at all? Isn't this part of HTTP/1.1 that server has to support?
from undici.
Probably, I’ll take a look. This might be another one of those edge cases.
Sorry to bring up every possible edge case. Just trying to be throughout.
from undici.
How are other clients doing it, if at all? Isn't this part of HTTP/1.1 that server has to support?
@szmarczak do you have any input?
from undici.
Isn't this part of HTTP/1.1 that server has to support?
No. Pipelining happens only on a persistent (keep-alive) connection and is optional. Unfortunately the HTTP/1.1 RFC does not specify how to verify whether the server supports pipelining or not and how many concurrent requests at maximum it should have.
from undici.
Unfortunately the HTTP/1.1 RFC does not specify how to verify whether the server supports pipelining or not and how many concurrent requests at maximum it should have.
I mean... you can kind of detect it by sending a request to the server and see what it does.
So basically the logic here would be that the client does not pipeline until the first request has succeeded with a persistent connection in order to indicate that the server seems to support pipelining.
from undici.
you can kind of detect it by sending a request to the server and see what it does.
One request is not sufficient. Because the connection is keep-alive it doesn't mean that it supports pipelining (according to the RFC). But I too think that most servers do support pipelining. To check if the server supports pipelining, you need to make two requests.
I see your point. I say let's assume that every keep-alive
server does support pipelining, then only one request is enough to make the check.
from undici.
Yup. What happens otherwise? Does it throw when there already requests queued?
from undici.
Seems to be fine :)
from undici.
Related Issues (20)
- WHATWG handling of URLs that include username:password (credentials) HOT 14
- Large number of parallel requests always result in an error HOT 2
- Content-Length header should be ignored by fetch HOT 4
- Fetching headers of small files causes node process to terminate after 8 seconds since GHSA-9f24-jqhm-jfcw HOT 1
- Implement HTTP caching HOT 11
- Only use one network request when identical requests are made HOT 6
- TypeError and Access Issues in jsdom Environment Post Update to undici 6.16.0 HOT 4
- websocket: a number of conditions fail the connection but do not emit an error event
- websocket: handle parser errors more consistently
- running autobahn test suite HOT 4
- Failing autobahn tests HOT 6
- Interceptors: add response decompress interceptor HOT 4
- Implement Request/Response `.bytes()` method
- permessage-deflate support in websocket HOT 1
- Optimization of websocket masking HOT 9
- bug: spreading `Headers` object has breaking behavior in versions between Node 20.12 and 20.13 HOT 9
- Limit the maximum numbers of open sockets HOT 2
- interceptors: move `throwOnError` to interceptor HOT 5
- interceptors: move signal handling to interceptor
- Support for custom proxy auth schemes HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from undici.