Skip to content

Support Content-Encoding: gzip #48

Description

@ephrin

as mentioned in #35 (comment)
could be interesting to implement gzip encoding for server responses.

So I've started some impl and researches.

Now I have some questions:

  • should it be encoded automatically when got Accept-Encoding: gzip in major qvalue?
  • should force encoding be triggered by specifying Content-Encoding: gzip header by a user?

Activity

  1. WyriHaximus commented on Dec 25, 2015

    @WyriHaximus
    Member

    Yes on both, but IIRC nginx has some config option to exclude certain clients because they have issues decoding: http://nginx.org/en/docs/http/ngx_http_gzip_module.html#gzip_disable Generally those options are interesting to look at and see if we should consider some of them.

  2. ephrin commented on Jan 13, 2016

    @ephrin
    Author

    @WyriHaximus I need to prevent streaming chunks of data if a response has Content-Encoding. Are you ok with it? I mean - it must be some kind of buffer.

  3. clue commented on May 20, 2016

    @clue
    Member

    @WyriHaximus I need to prevent streaming chunks of data if a response has Content-Encoding. Are you ok with it? I mean - it must be some kind of buffer.

    I'm not sure I follow :) Have you seen https://github.com/clue/php-zlib-react ?

    • should it be encoded automatically when got Accept-Encoding: gzip in major qvalue?

    We should probably add some kind of config for the consumer of this lib to decide whether compression makes sense in the first place.

    • should force encoding be triggered by specifying Content-Encoding: gzip header by a user?

    I'm undecided on this tbh. I'd love to see a PR so we see its implications 👍 Also, how do others (node etc.) handle this?

  4. WyriHaximus commented on Feb 7, 2017

    @WyriHaximus
    Member

    @clue with regards to reactphp/http-client#50 (comment) how likely is it that we could implement this at all?

  5. clue commented on Feb 8, 2017

    @clue
    Member

    The known inconsistencies essentially boil down to this:

    This means that implementing this here appears reasonable as long as we provide some level of control for the consumer to explicitly enable/disable this in case they are affected by one of these inconsistencies.

  6. changed the title [-]gzip Content-Encoding[/-] [+]Support Content-Encoding: gzip[/+] on Feb 10, 2017
  7. christoph-kluge commented on Sep 11, 2017

    @christoph-kluge
    Contributor

    Since ReactPHP Supports now Middlewares.. I made up a quick and dirty gzip compressor for php7+
    https://gist.github.com/christoph-kluge/a8a3d4cc217fa42c9b2a38c3acd0a745

    might be a good starting point.

  8. christoph-kluge commented on Oct 15, 2017

    @christoph-kluge
    Contributor

    @ephrin if you take a look at the 3rd party middleware-wiki-page then you'll find the christoph-kluge/reactphp-http-response-compression-middleware. Does this solve your issue?

  9. ephrin commented on Oct 18, 2017

    @ephrin
    Author

    @christoph-kluge it should ^) but am currently not working on this and no plans for future regarding

  10. jsor commented on Oct 18, 2017

    @jsor
    Member

    Closing as this seems to be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions