Skip to content
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

Implement gzip content encoding #37

Closed
clue opened this issue Sep 3, 2015 · 10 comments
Closed

Implement gzip content encoding #37

clue opened this issue Sep 3, 2015 · 10 comments

Comments

@clue
Copy link
Member

clue commented Sep 3, 2015

No description provided.

@WyriHaximus
Copy link
Member

👍 , fully agree on adding this. My main concern is how to do it non-blocking. A child process could be an option unless you know a good way to do it streaming chunk by chunk in future ticks.

@clue
Copy link
Member Author

clue commented Sep 3, 2015

Gzip encoding/decoding should in fact not actually be part of this library. It should be added as a dependency here.

I suppose it makes sense to build this on top of PHP's ZLib functions. I've started looking into building a streaming gzip encoder/decoder a while ago but have never been quite happy with its API.

Can't promise anything, but I'll try to look into this 👍

@WyriHaximus
Copy link
Member

It should not be part of this library at all but we need to find a way to make it non-blocking so we can use it within this library. A streaming encoder/decoder sounds great and that is something we could use in react/http as well.

@clue
Copy link
Member Author

clue commented Sep 3, 2015

make it non-blocking

IMO this is a non-issue for two reasons:

  • zlib can easily decompress 100+ MByte/s on even a moderate system
  • React PHP's Stream implementation uses usual chunk sizes of 4 KiB each

This means that using a blocking decompressing algorithm for individual chunks can be considered non-blocking for the purpose of this library :-)

(Obviously, this doesn't apply if you're decompressing a multi-megabyte string variable – which does not apply to this library)

@clue
Copy link
Member Author

clue commented Nov 5, 2015

Can't promise anything, but I'll try to look into this 👍

Just for the reference, I've started looking into the available implementation approaches a few weeks ago: clue/reactphp-zlib#1

Using PHP's zlib stream filters works okay-ish. I'm currently working around some of its limitations:
clue/reactphp-zlib#3 (comment)

@clue
Copy link
Member Author

clue commented Nov 15, 2015

For the reference again, I've pushed an initial v0.1.0 release of clue/zlib-react a few days ago. This can now be integrated here to offer HTTP compression support (gzip and/or deflate).

I hear @WyriHaximus is working on this? 👍

@WyriHaximus
Copy link
Member

Not just working on it, I have a working prototype getting molded into a PR :)

@ghost
Copy link

ghost commented Jul 12, 2019

@WyriHaximus What is the status of your prototype?

@WyriHaximus
Copy link
Member

@CharlotteDunois about 3 and a half years old now so no clue. Feel free to build something because it has been ages

@clue
Copy link
Member Author

clue commented Jul 12, 2020

I have to close this one as per #152 now that future development will focus on https://github.com/reactphp/http instead.

I've migrated this ticket to reactphp/http#377.

@clue clue closed this as completed Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants