Early Return HTTP Response, but continue to compute #28
Replies: 5 comments 1 reply
-
worth noting, I'm not aware of any other platform that allows this, except in a very-restricted edge environment! For example Vercel only lets you |
Beta Was this translation helpful? Give feedback.
-
This would be great for #7 ! |
Beta Was this translation helpful? Give feedback.
-
🎉 We've just shipped an optimization for this! Web & Express handlers now respond to HTTP request as soon as the val returns a response. This will produce a general speedup across the board, because we've noticed that even vals that don't have any straggling, unawaited Promise objects still take about an additional 80-100ms to exit. So it is now possible to run async work after an HTTP response has been generated and sent. In the future, we do want to support |
Beta Was this translation helpful? Give feedback.
-
Amazing!!! 🎉 🎉 🎉 the implementation sounds great, so excited to use this! |
Beta Was this translation helpful? Give feedback.
-
This is a common ask. One way to do it is how cloudflare / vercel do it with a
waitUntil
Promise.Another way is to make this the default behavior for un-
await
ed Promises.Beta Was this translation helpful? Give feedback.
All reactions