You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now it seems like if we want to inject some content from a sub request we would use an async handler like so:
asyncelement(e){constresponse=awaitfetch(url);// make sub requestconsttext=awaitresponse.text();// whole text buffered in memor, this blocks from sending more data until we get full responsee.append(text);// insert text into main content}
But isn't this sort of wasteful a bit, I mean we are needing to buffer the whole subrequest in memory and need to wait for the whole response to finish.
Wouldn't it be better if the rewritter would support something like this:
asyncelement(e){constresponse=awaitfetch(url);// make sub requeste.append(response.body);// if stream provided it is correctly injected and streamed}
In this case we will be returning the sub requests chunks as soon as they come and won't buffer them fully in memory.
The text was updated successfully, but these errors were encountered:
Right now it seems like if we want to inject some content from a sub request we would use an async handler like so:
But isn't this sort of wasteful a bit, I mean we are needing to buffer the whole subrequest in memory and need to wait for the whole response to finish.
Wouldn't it be better if the rewritter would support something like this:
In this case we will be returning the sub requests chunks as soon as they come and won't buffer them fully in memory.
The text was updated successfully, but these errors were encountered: