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
Lwt.return @@ with_encoded_body ~algorithm body response
This appears to read the entire body into memory, and then compress it. I assume (perhaps wrongly) that the underlying compression algorithms support streaming, and it seems like streaming would be more beneficial for precisely the kind of responses that you wouldn't want to load into memory an extra time (large ones).
The text was updated successfully, but these errors were encountered:
assume (perhaps wrongly) that the underlying compression algorithms support streaming
It does! In fact, the compression function (which is almost identical to decompress's documentation example) creates a stream from the given string, so refactoring this to work on stream responses should be trivial 🤞
e.g.:
dream-encoding/lib/dream_encoding.ml
Lines 194 to 195 in dde4204
This appears to read the entire body into memory, and then compress it. I assume (perhaps wrongly) that the underlying compression algorithms support streaming, and it seems like streaming would be more beneficial for precisely the kind of responses that you wouldn't want to load into memory an extra time (large ones).
The text was updated successfully, but these errors were encountered: