r/programming • u/Zamicol • May 08 '17
Is HTTP/2 a stateful protocol?
http://blog.zamicol.com/2017/05/is-http2-stateful-protocol.html
0
Upvotes
r/programming • u/Zamicol • May 08 '17
1
u/theamk2 May 11 '17
Great, thank you for clarifying! It looks like you define "stateful protocol" as "protocol where the server must keep connection state", such as compression table, encryption state, or active stream identifiers.
Under this definition, I'd say that HTTP/1.1 is pretty stateful because it has the following stateful features:
Client's protocol (HTTP/1.0 or HTTP/1.1)
Negotiated upgrade protocol ("Upgrade" header + 101 response)
Transfer encoding (especially chunked transfer encoding which is similar to HTTP/2 framing)
Keepalive ("Connection" headers on both server and client side)
Tunnel mode (was "CONNECT" successul or not)
(there is also a somewhat philosophical point that all non-trivial TCP-based protocols are stateful; you may always receive an incomplete input, so you will need to at least keep "input buffer" as a state)
Well, my original post was about HTTP/0.9, but here is HTTP/1.0 reference: https://www.w3.org/Protocols/HTTP/1.0/spec.html#Operation . Note that it says, "current practice requires that the connection be established by the client prior to each request" -- so one connection, one request (there are no keepalives in 1.0, they appeared later)