Skip to content

expose callback for sending an interim response - #29

Merged
kazuho merged 2 commits into
masterfrom
kazuho/informational-response
Jun 24, 2016
Merged

kazuho merged 2 commits into
masterfrom
kazuho/informational-response

Conversation

@kazuho

@kazuho kazuho commented May 17, 2016

Copy link
Copy Markdown
Owner

A subref is exported as psgix.informational for sending an interim response, defined in RFC 7231 section 6.2.

6.2.  Informational 1xx

   The 1xx (Informational) class of status code indicates an interim
   response for communicating connection status or request progress
   prior to completing the requested action and sending a final
   response.

The subref takes two arguments. The first argument is the 1xx status code to be sent to the client. The second argument is an reference to an array of headers that should be sent. In other words, it is the same as the PSGI response but without a body.

The intended use-case of the extension is to to trigger HTTP/2 servers running downstream start pushing the specified resources (e.g. CSS, JavaScript) while the PSGI application generates a response. By using the extension, PSGI applications can send a set of link: rel=preload headers associated to an 1xx response (which is recognized by the HTTP/2 servers as a signal to start pushing the assets), and then process the request.

see also: h2o/h2o#672 (comment)

@kazuho

kazuho commented May 17, 2016

Copy link
Copy Markdown
Owner Author

@miyagawa Do the choice of the name and the signature of the subref look sensible? Or does an extension for sending an interim response already exist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant