HTTP 1.1의 동작방식

HTTP는 웹 상에서 클라이언트와 웹 서버간 통신을 위한 프로토콜 중 하나이다. HTTP1.1은 기본적으로 연결 당 하나의 요청과 응답을 처리하기 때문에 동시 전송이 불가능하고 요청과 응답이 순차적으로 이루어지게 된다. 이렇다 보니 HTTP 문서 안에 포함된 다수의 리소스(Image, CSS, Script)를 처리하려면 요청할 리소스 개수에 비례해서 Latency(대기시간)가 길어진다. 이처럼 HTTP 1.1은다수의 리소스를 처리하기에 속도와 성능 이슈를 가지고 있다.

HTTP 1.1의 단점

이러한 문제점들을 해결 하기위한 (퍼포먼스를 향상시키기 위해) HTTP/2가 등장하였다. HTTP/2는 성능 뿐만 아니라 속도면에서도 월등하다. Multiplexed Streams(한 커넥션에 여러 개의 메세지를 동시에 주고 받을 수 있음), Stream Prioritization(요청 리소스 간 의존관계를 설정), Server Push(HTML 문서상에서 필요한 리소스를 클라이언트 요청없이 보내줄 수 있음), Header Compression(Header 정보를 HPACK 압축방식을 이용하여 압축전송)을 사용하여 성능을 획기적으로 향상 시켰다.

HTTP/2

"HTTP/2 is a replacement for how HTTP is expressed “on the wire.” It is not a ground-up rewrite of the protocol; HTTP methods, status codes and semantics are the same, and it should be possible to use the same APIs as HTTP/1.x (possibly with some small additions) to represent the protocol. The focus of the protocol is on performance; specifically, end-user perceived latency, network and server resource usage. One major goal is to allow the use of a single connection from browsers to a Web site." - http2 공식 github

즉, 목적은 성능 향상