Support for 103 Early Hints?

Hi there, I learned about the 103 Early Hints origin trial today and was excited to try it out on my app, due to the potential for flattened module waterfalls with native unbundled es-modules.

I added the fastify-early-hints plugin to my app and tested it out locally with some apparent success:

curl -D - http://localhost:8080
HTTP/1.1 103 Early Hints
Origin-Trial: <token>
Link: </main.js>; rel=preload; as=script 

HTTP/1.1 200 OK
origin-trial: <token>
content-type: text/html
content-length: 2442
Date: Fri, 01 Oct 2021 11:00:17 GMT
Connection: keep-alive
Keep-Alive: timeout=5

<!DOCTYPE html>
<html lang="en">
...

However, once I deployed the app to fly, the 103 response is nowhere to be seen:

curl -D - https://<app-name>.fly.dev
HTTP/2 200 
origin-trial: <token>
content-type: text/html
content-length: 2442
date: Fri, 01 Oct 2021 11:13:19 GMT
server: Fly/8a7eeb5 (2021-09-30)   
via: 2 fly.io
fly-request-id: 01FGXRXZQQKX5FB9Y8C7TJQP9M

<!DOCTYPE html>
<html lang="en">
...

Curious if there might be some limitation in the fly proxy that might be preventing the 103 response from reaching the client?

3 Likes

This is interesting. Our HTTP handler would need some work to support it. You may be able to get it working if you disable the http handler in your fly.toml.

It may not be hard for us to add support, though, this isn’t all that different than a websockets upgrade.

2 Likes

I would love to see support for this. Adding support in Remix (express) is trivial and would yield a good perf boost for all apps out of the box.

2 Likes

Any update here? It seems like our site’s early hints get stripped out by fly :frowning:

Curious if this is in the plans for the near future :thinking:

@containerops, we’ve talked about this some internally. We are slightly at the mercy of the library we use for building our http handler. Until they add support we probably won’t have it. We’ll keep this thread updated though if that changes.

1 Like