Open mtchuyen opened 2 years ago
https://200lab.io/blog/http2-la-gi/
https://viblo.asia/p/tong-quan-http2-aWj53OEQ56m
Mục tiêu chính của HTTP/2 là reduce latency
(giảm độ trễ) bằng cách:
full request
và response đa kênh, nén có hiệu quả các HTTP headers
. đánh ưu tiên các request
và Server push
Source: https://viblo.asia/p/toi-uu-tai-trang-voi-http2-server-push-va-nodejs-63vKjaqk52R
https://www.smashingmagazine.com/2017/04/guide-http2-server-push/
https://wptangtoc.com/http-2-push
HTTP/2 Push cho phép các lập trình viên nhà quản trị trang web xác định nội dung file cụ thể nào đó sẽ được đẩy gửi sớm nhất đến trình duyệt của người dùng cùng với tài liệu HTML (sớm nhất có thể).
vấn đề preprocess-Handler: tiền xử lý handler, nghĩa là các hoạt động trước khi thực hiện xử lý logic handle đó.
https://stackoverflow.com/questions/31770872/router-in-go-run-a-function-before-each-http-request
https://rickyanto.com/how-to-write-simple-middleware-using-go-nethttp-standard-library/
https://themue.dev/blog/2019/03/23/dont-be-afraid-of-multiplexing/
curl -I --http2-prior-knowledge https://beta.domain.com/infor.html
Show body response with http2 protocol:
curl --http2-prior-knowledge -s -w "%{http_code}\n" -o /tmp/tmpFifo 127.0.0.1:1234/infor.html
Client send by POST method:
reqbody := bytes.NewReader(out)
resp, err := client.Post("https://beta.domain.com/app_view", "application/octet-stream", reqbody)
https://unix.stackexchange.com/questions/631001/why-is-haproxy-forwarding-http2-requests-as-http-1-1
https://www.haproxy.com/fr/blog/haproxy-2-0-and-beyond/#end-to-end-http-2
https://andreaskaris.github.io/blog/networking/haproxy-and-h2c/
https://www.haproxy.com/documentation/hapee/latest/load-balancing/protocols/http-2/
Handling HTTP request in Go Echo framework (1): https://medium.com/@ykyuen/handling-http-request-in-go-echo-framework-1-2b564663024
Build a Golang RESTful Stock API With the Echo Framework: https://betterprogramming.pub/intro-77f65f73f6d3
netstat -antup | grep :6379 | grep "establish" | wc -l
🔌 Handle 'connection reset by peer' error in Go:
http://www.inanzzz.com/index.php/post/9ats/http2-and-tls-client-and-server-example-with-golang
The performance benefits of HTTP/2 come from simultaneous/parallel (pipelining) and batch requests. For example based on my tests, HTTP/2 was able to handle 500,000 requests (30sec~) but HTTP/1 barely managed 100 requests with many "broken pipe", "connection reset by peer" errors. The tests issued requests as in goroutines.
why is golang http server failing with broken pipe when response exceeds 8kb?
https://www.appsloveworld.com/go/5/why-is-golang-http-server-failing-with-quotbroken-pipequot-when-response-exce