Nextjs + Vercel how to configure http2
Unanswered
Asiatic Lion posted this in #help-forum
Asiatic LionOP
I have a next js app using app router deployed using vercel and I am trying to configure it so that it's using http2.
I've managed to do it locally by adding this a custom server.js, but can't get the deployed version to work
I've managed to do it locally by adding this a custom server.js, but can't get the deployed version to work
17 Replies
@Asiatic Lion I have a next js app using app router deployed using vercel and I am trying to configure it so that it's using http2.
I've managed to do it locally by adding this a custom server.js, but can't get the deployed version to work
a custom server requires a long-running proccess which is something not supported by vercel. that being said, vercel should already be serving the app with HTTP/2
fwiw even if you were gonna self-host your app you shouldn't be handling this on the app level (like with a custom server) but on the infra level (e.g. a reverse proxy)
fwiw even if you were gonna self-host your app you shouldn't be handling this on the app level (like with a custom server) but on the infra level (e.g. a reverse proxy)
Just like @Rafael Almeida said - Supporting protocols should be done on Infrastructure level. Anyways Vercel is hosting with HTTP/2, but you can go further with HTTP/3 and QUIC using Cloudflare proxy in tandem with Vercel. If you will need I would be very glad to assist you with that configuration. 🙂
PoC: https://http3check.net/?host=https%3A%2F%2Fwww.rescale.build
PoC: https://http3check.net/?host=https%3A%2F%2Fwww.rescale.build
Asiatic LionOP
hey guys thanks for the replys
my understanding was as well that vercel should already host http2, but for some reason or my request are still on http1 so i am still struggling to understand why that would be
i am going to have a look at http3 too but would still wish to figure out why vercel is not using http2 on my app
appreciate all the answers
could you share public deployment url with us? I hope there are many people that can look at it and check that for you. A bit of endpoint code won’t hurt as well 😄
ofc
I'd basically expect all these +. some of the other resources to be http2
Ok, will check that tomorrow 🙂
Asiatic LionOP
hmmm, that's weird
@Rafael Almeida all of them are being sent with http2 for me, might be an issue on your end
Asiatic LionOP
i imagine you're using chrome?
ik the client needs to support them as well but I don't see why my browser wouldn't lol
yeah its chrome, but it also works with firefox
Asiatic LionOP
so weird