|
|
|
|
|
by wonnage
1418 days ago
|
|
Trailers would be theoretically useful in a variety of HTML streaming-related cases if they actually had widespread support (but they don't): - sending down Server-Timing values for processing done after the headers are sent
- updating the response status or redirecting after the headers are sent
- deciding whether a response is cacheable after you've finished generating it All of these except the first one obviously break assumptions about HTTP and I'm not surprised they're unsupported. Firefox [1] actually supports the first case. The rest have workarounds, you can do a meta-refresh or a JS redirect, and you could simply not stream cacheable pages (assuming they'd generally be served from cache anyway). But it's still the case that frontend code generally likes to throw errors and trigger redirects in the course of rendering, rather than performing all that validation up front. That's sensible when you're rendering in a browser, but makes it hard to stream stuff with meaningful status codes. |
|