19 Şubat 2020 Çarşamba

HTTP/2

Giriş
Açıklaması şöyle.
The way a browser connects to HTTP/2 is through a URL that looks exactly the same as the URL for HTTP/1, so it doesn't know that it must be HTTP/2 just from looking at the URL. It will try plain cleartext HTTP if it is given a http:// URL. In order for the browser to not try plain HTTP, the URL must be https:// (and then HTTP/2 upgrade will happen through ALPN), ....
TCP
HTTP/2 altta TCP kullanıyor.

Multiplexing - Aynı Bağlantının Farklı Stream'ler İçin Kullanılması
HTTP/1 Multiplexing desteklemezken, HTTP/2 destekliyor. Açıklaması şöyle. Multiplexing aynı bağlantının farklı istekler için tekrar kullanılması demek. Bağlantı tekrar tekrar kurulmadığı için TLS gibi ağır yük getiren şeyler daha verimli oluyor.
Multiplexing allows the reuse of existing connections by creating multiple streams per connection, each able to send a request. Rather than requiring a connection for every request, we could reuse the same connection for many simultaneous requests. The more we reuse connections, the less overhead we have in establishing mTLS sessions with roundtrips, handshaking, and so on.
Benzer bir açıklama şöyle
HTTP/2 improves over HTTP/1.1 and introduced the new feature of ‘Multiplexing’. This allowed sending multiple requests as separate streams to the server over a single connection and the server will send responses over the streams back to the client. This way inter-service communication is now relatively faster.
Multiplexing ile tam ilgisi olmasa bile (sanırım) HTTP/2 ile paralel veri göndermek mümkün. Açıklaması şöyle
Latency Optimization
Latency restricts the performance of the system; hence it is necessary to optimize it. We can reduce it by adopting the following measures:

HTTP/2: We can reduce it by the use of HTTP/2. It allows parallelized transfers and minimizes the round trips from the sender to the receiver, which are highly effective in reducing the latency.
...
Binary Protocol
HTTP/1 Text Protocol kullanırken, HTTP/2 Binary Protocol kullanıyor. Açıklaması şöyle
HTTP/2 uses binary protocol instead, which is more efficient to parse and more compact, less error-prone compared to textual protocols. 
Önceliklendirme
Açıklaması şöyle
- It provides the ability to prioritize one resource over another and hence place it on the response line head.
- It allows for the unsolicited push of representations from servers to clients.
- The request and response headers are compressed.
- Frames are delivered on streams and the DATA frame payload is subject to flow control.
Stream Id
Açıklaması şöyle
Stream identifiers cannot be reused. Long-lived connections can result in an endpoint exhausting the available range of stream identifiers. A client that is unable to establish a new stream identifier can establish a new connection for new streams. A server that is unable to establish a new stream identifier can send a GOAWAY frame so that the client is forced to open a new connection for new streams.

Hiç yorum yok:

Yorum Gönder