-
-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compress/gzip dream responses [evaluate dream-encoding library] #67
Comments
@mooreryan It is possible in principle, but I haven't looked into it in detail, picked a compression library, made any specific suggestions, etc. @tmattio has mentioned that he was interested in making a library of Dream helpers for this. Now that you've asked, I'm also considering making an example about it. |
Ah your tip about @tmattio seems correct...I saw this https://github.com/tmattio/dream-encoding and the |
Ah nice. I'll link to it from this repo once dream-encoding is released, has proper README (as mentioned in the current README), etc. :) |
Another README to write, I promise I'll get to them soon @aantron 😄 |
dream-encoding is now installable from opam (and by esy), and recommended in Dream's README. For usage with large responses, Dream will need to rework the I/O a little bit (relax the types, etc.) to make it easier for middlewares to do stream processing. After that, dream-encoding should be changed internally to do streaming compression (it is ready, just needs to change the Dream functions it is calling once they are ready). So, I want to leave this issue open until that Dream I/O rework, and potentially also until there is an example in Dream that shows dream-encoding. |
A side note: it would be really nice if the eventual solution to this problem accounted for caching/preparing the results of compressing static resources (maybe especially those coming out of an |
Update to h2.0.9.0
Hey aantron, so I've coded up a little api using dream, and one thing I can't find in the docs mentioned is if it is possible to compress/gzip responses.
Is this possible? I was thinking maybe using the stream response in combination with an ocaml gzip library.
Thanks!
The text was updated successfully, but these errors were encountered: