1

I am working on writing a resilient client for HTTP/2. I am wondering what should be the behavior of the client, if the server sent a PUSH_PROMISE and then failed to send the PUSH_RESPONSE, related to that PUSH_PROMISE ?

I went through the HTTP/2 spec, about the Push Response, but it does not state what should we do in such scenarios.

  • Should we send the original request again, if the push response is not received ? If the original request sent successfully, sending it again may cause issues, isn't it ?
  • Or should we ignore the PUSH_PROMISE and continue ? In that case, say server promised to send a file, and did not send it, what will happen ?

Is there a defined way to resolve this ?

Community
  • 1
  • 1
ThisaruG
  • 3,222
  • 7
  • 38
  • 60

2 Answers2

1

The client is certainly free to request the same resource again. Consider, for example, that the server has no way to know if the client is making a simultaneous request for the same resource when the server sends the PUSH_PROMISE.

Client                  Server
------                  ------
HEADERS[sid:1, GET /]
                         HEADERS[sid:1, /], DATA [sid:1], PUSH_PROMISE[sid:2]
HEADERS[sid:3, GET /css] HEADERS[sid:2, /css], DATA[sid:2]
                         HEADERS[sid:3, /css], DATA[sid:3]


The standard way for the client to then cancel the push would be to reset the promised stream via a RST_STREAM.

Frederik Deweerdt
  • 4,943
  • 2
  • 29
  • 31
-1

PUSH PROMISE - All server push streams are initiated via PUSH-PROMISE frames, which signal the server’s intent to push the described resources to the client and need to be delivered ahead of the response data that requests the pushed resources. The simplest strategy to satisfy this requirement is to send all PUSH-PROMISE frames, which contain just the HTTP headers of the promised resource, ahead of the parent’s response.

PUSH_PROMISE method used to apply HTTP/2 server push because the server creates the PUSH_PROMISE frame to the response part of a normal browser- initiated stream. Response objects with the context of a request which has a HTTP connection is used to server push. for example, under the Page_load method of application which has HTTP connection can be used to apply Response.PUSHPROMISE for push all the relevant scripts, styles and images without the client having to request each one explicitly