[PATCH 1 of 2] HTTP: add support for trailers in HTTP responses

Maxim Dounin mdounin at mdounin.ru
Thu Jul 21 13:44:30 UTC 2016


Hello!

On Wed, Jul 20, 2016 at 06:33:11PM -0700, Alexey Ivanov wrote:

> 
> > On Jul 20, 2016, at 6:23 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> > 
> > Hello!
> > 
> > On Wed, Jul 20, 2016 at 03:34:46PM -0700, Alexey Ivanov wrote:
> > 
> >> Speaking of trailers: we had couple of use cases for HTTP
> >> trailers, most of them were around streaming data to user.
> >> 
> >> For example, when webpage is generated we send headers and part
> >> of the body(usually up to `</head>`) almost immediately, but
> >> then we start querying all the micro services for the content
> >> (SOA, yay!).
> >> The problem is that upstreams will inevitably fail/timeout, and
> >> when that happens there is no way to pass any metadata about the
> >> error to nginx, since headers are already sent. Using trailers
> >> here may improve MTTR since backend metadata is available on the
> >> frontend.
> >> 
> >> Another example may be computing checksums for data while you
> >> stream it and putting it in the trailer. This should reduce TTFB
> >> by quite a lot on some workloads we have.
> > 
> > Do you actually use something like this, or know places where
> > something like this is actually used?
> These are examples from our production. Currently we are using 
> workarounds for both of these problems. Though I'm not sure that 
> we would use trailers if they were supported, since it's one of 
> very obscure HTTP/1.1 features that people do not usually know 
> about.
> 
> That is starting to change bit by bit though, since people try 
> using gRPC more and more.

Could you please elaborate what exactly you do use now and if you 
know any examples of trailers being used instead?

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx-devel mailing list