gin-gonic / gin

Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
https://gin-gonic.com/
MIT License
78.58k stars 8.01k forks source link

Early Hints support? #3337

Open the-hotmann opened 2 years ago

the-hotmann commented 2 years ago

I am curious if gin does have support for early hints?

What have I tried so far?

  1. Since Early Hints are replacing HTTP/2 Push, I tried to go with the example of HTTP/2 Push, but this does not send a 103 response with the link headers.
  2. I tried to just set the link header and hoped that gin automatically converts it to an early hint. But it did not. This was the code I used to set the header: c.Writer.Header().Set("link", "</app.min.css>; as=style; rel=preload")

Both tries did not result in gin sending 103 responses. So I am curious if gin at all is able to send 103 responses (aka. Early hints), or not. A quick research showed me that golang itself is capable of sending Early Hints.

Does anyone have a clue on how to send Early hints? :)

Thanks!

pscheid92 commented 2 years ago

I think this is a duplicate of #3289.