Hacker News new | ask | show | jobs
by AgentME 1379 days ago
Yeah, in previous discussions I've seen about HTTP/2 Server Push, it seems like a lot of people are confused about what it was and thought it could be used to let a server spontaneously message a client (like you can do with websockets or server-side events). The only thing Server Push does is let a server respond to one request with multiple responses together ("I see you're requesting X, but I know clients who ask for X end up asking for Y shortly after, so here's Y with your X so you can cache it for later").
1 comments

I’m not a web guy, was Server Push replaced with / rolled back to a socket for server async communication?
Server push doesn't let a server spontaneously communicate with a client like a socket does. It's purely an optimization to let the server include in a response to the client extra resources for the client to cache for later, possibly making it so the client doesn't have to request them later. If server push doesn't happen, then it just means the client might not have certain resources pre-cached and will have to request them later.