Skip to content
Discussion options

You must be logged in to vote

This is not an issue with Remix but with how HTTP works. When you send an HTTP response, you send something like this:

HTTP/1.1 200 OK
Content-Type: application/json

{"hello": "world"}

Notice that the response starts with the version and the status code, then the headers and finally after a blank line, the body.

The body of a request can be streamed, which means the server can send the first part of the response and then send the body as it's being generated, this is what Remix is doing when you use defer to send a promise, it's sending something like this:

HTTP/1.1 200 OK
Content-Type: application/json

// here it waits until the promise is resolved
{"hello": "world"}

The problem come…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@Gn3po4g
Comment options

@sergiodxa
Comment options

@Gn3po4g
Comment options

Answer selected by Gn3po4g
Comment options

You must be logged in to vote
1 reply
@sergiodxa
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants