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

Alexey Ivanov savetherbtz at gmail.com
Thu Jul 21 01:33:11 UTC 2016

> 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.
> Obviously enough, trailers have lots of theoretical use cases, and
> that's why there were introduced in HTTP/1.1 in the first place.
> The problem is that it doesn't seem to be used in the real world
> though.
> --
> Maxim Dounin
> http://nginx.org/
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20160720/28280c09/attachment.bin>

More information about the nginx-devel mailing list