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

Maxim Dounin mdounin at mdounin.ru
Thu Jul 21 01:23:23 UTC 2016


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?

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/



More information about the nginx-devel mailing list