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?

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.

1 Like