-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider removing trailers API #772
Comments
I dropped a note to @igrigorik who is out, since it looks like https://w3c.github.io/server-timing/ has a normative dependency on Trailers, at least in the current tip of tree |
cc @valenting |
AFAICT the server timing spec reference to trailers doesn't have a dependency on the fetch API. |
I think it's more that if that's implemented already, you already need a robust trailer infrastructure that would be easyish to expose through an API. And arguably should be exposed at that point, as we want to give developers access to the primitives. |
... and Firefox has implemented trailer support for Server-Timing. I'd hope that one implementation deciding not to put resources into a feature doesn't mean we pull that feature from the Web platform; if that's the bar, Chrome is going to be out on its lonesome with a lot of features... |
Firefox has not implemented the trailers promise as far as my testing shows. Furthermore, per the WHATWG working mode, we need multi-implementer interest to keep a feature. My understanding is that trailer support was added based on Firefox + Chrome interest, but Chrome has since withdrawn support. |
At the time it seemed there was interest from most browsers at the HTTP workshop. And while Firefox has not implemented the promise, it has implemented trailers, which then argues for exposing it as per my earlier comment. If Edge and Safari don't want to implement this though and are not implementing Server-Timing either (or at least the trailer aspect) I tend to agree that the case for keeping this would be non-existent. |
I'm not aware of any "negative" signals to that extent from either. ST is under consideration for Edge. |
Maybe @youennf and @travisleithead can speak as to whether Safari/Edge intend to implement the |
@aliams who can speak to the fetch |
As an update, I've been trying to figure out how viable trailers are for browsers in httpwg/http-core#16 and also httpwg/http-core#18. I'm getting the impression they're more trouble than they're worth given that clients are allowed to combine them with "normal" headers. |
For WebKit, this feature should be implementable. I am not aware of requests being made to support this feature. |
There's pretty much a standing request from CDNs and some content engines to allow ETag and Last-Modified, as well as perhaps Cache-Control, to be sent in trailers, as that would allow them to avoid buffering dynamic content server-side in some situations. |
This is somehow a bit orthogonal to a trailers API though. WPT tests specific to ETag/Last-Modified/Cache-Control trailers and how it impacts the various browser caches might help implementors, find potential edge cases... |
A real-world use case and need for Trailer support and Server-Timing: tl;dr: we need trailers to emit timing and debug data about where time was spent as the page is being constructed, after the content is flushed. Forcing output buffering is both bad for user experience and performance, as well as causes random failures due to broken interleaving of flushes in real world applications like WordPress. If we had Trailers, we could collect the timing data and emit the header at the end — clean 'n simple. |
I started implementing trailers in |
@igrigorik that's not a request for the generic trailer API though, is it? |
Also, how is Server-Timing supposed to work when it ends up in the header block? |
I at least had an idea on how to solve this - use key - value where the value is a lambda that gets evaluated when it’s enumerated. |
What does "generic API" equate to in your head? As discussed previously, ideally what I would like to see is trailer headers be treated as inert (don't impact regular response processing) but readable from Fetch by the application. Specific use cases, like Server-Timing can then build on top of that to provide own layer of functionality.
Not sure I follow.. As in, non-trailer header block? It would work as it does today. |
@igrigorik okay, so a JavaScript API to get all trailers the server transmitted? As for the Server-Timing question, I was asking as trailers are apparently always allowed to be appended to the non-trailer headers by an intermediary, which seems rather sketchy to me. And that's also a concern for the JavaScript API, that folks might rely on getting some trailer header but a user behind an intermediary wouldn't have it and get some kind of failure. |
Yep.
Right, I think that's WAI — @mnot please chime in here if not so. If you have an intermediary that's buffering the full response before flushing it (which is a terrible idea, but that's beside the point), they could move trailer content into the header block. I don't think we can stop that, and I'm also not sure that's a "problem" that we need to be concerned about.. After all, same intermediary may also arbitrarily strip headers due to various policies. |
Agreed. The problems that are referred to AIUI are restricted to headers that the browser depends upon when it's processing the body (e.g., |
Per httpwg/http-core#220 the current API only addresses a subset of the trailer use cases. A more complete trailer API would require I'll remove the API for now as there's been no new interest in the past year and a half and open a new tracking issue to consider adding them back that lists the various new things that came to light as well as possible dependencies. Edit: See #980 and #981 for adding trailer support back. And see #979 for removing the current take from the Fetch Standard for reasons in the prior comment. |
As noted in #772 (comment) the current way it is exposed subsets what HTTP supports and therefore does not feel like a good starting point. Both for the internal and public API. Additionally, the public-facing API has not seen interest from implementers, at least for the past year and a half.
https://bugs.chromium.org/p/chromium/issues/detail?id=691599 was closed as WontFix today, and I don't recall anyone else interested in implementing.
The text was updated successfully, but these errors were encountered: