Skip to content

Add gzip support - #271

Closed
ben-ng wants to merge 3 commits into
socketio:masterfrom
ben-ng:master
Closed

ben-ng wants to merge 3 commits into
socketio:masterfrom
ben-ng:master

Conversation

@ben-ng

@ben-ng ben-ng commented Jul 29, 2014

Copy link
Copy Markdown

I personally wanted gzip support for long polling without needing nginx. This seems to work. Is there interest in adding this to engine.io or perhaps a separate module?

@rauchg

rauchg commented Jul 29, 2014

Copy link
Copy Markdown
Contributor

I'm down. But we need:

  • An option to turn it off (gzip: false)
  • Tests

@ben-ng

ben-ng commented Jul 29, 2014

Copy link
Copy Markdown
Author

Cool! Will add those after work.

@rauchg

rauchg commented Jul 29, 2014

Copy link
Copy Markdown
Contributor

Really appreciate it

@rauchg

rauchg commented Jul 29, 2014

Copy link
Copy Markdown
Contributor

Might also want to apply it for the jsonp transport.

@rauchg

rauchg commented Jul 29, 2014

Copy link
Copy Markdown
Contributor

Speaking of which, we might want to consider using this to turn off/on WebSocket DEFLATE frames

@3rd-Eden

Copy link
Copy Markdown
Contributor

you might also want to explore zopfli for compression.

@rauchg

rauchg commented Jul 30, 2014

Copy link
Copy Markdown
Contributor

Too slow, better for non-realtime compression, as it's basically brute force gzip.

We do use zopfli on the socket.io CDN
—
Sent from Mailbox

On Wed, Jul 30, 2014 at 1:38 AM, Arnout Kazemier notifications@github.com
wrote:

you might also want to explore zopfli for compression.

Reply to this email directly or view it on GitHub:
#271 (comment)

@ben-ng

ben-ng commented Jul 30, 2014

Copy link
Copy Markdown
Author

It slipped my mind this morning that I'm leaving on a short 5 day vacation today, so i'll finish up this PR when I get back if someone else doesn't beat me to it.

I measured the impact of this change on our prod server this morning, it's a 3x speed improvement for responses in the ~500kb range. Absolutely terrific, shaved 2 seconds off our app bootstrapping process.

@rauchg

rauchg commented Jul 30, 2014

Copy link
Copy Markdown
Contributor

Superb! Thanks for the update—
Sent from Mailbox

On Wed, Jul 30, 2014 at 1:48 AM, Ben notifications@github.com wrote:

It slipped my mind this morning that I'm leaving on a short 5 day vacation today, so i'll finish up this PR when I get back if someone else doesn't beat me to it.

I measured the impact of this change on our prod server this morning, it's a 3x speed improvement for responses in the ~500kb range. Absolutely terrific, shaved 2 seconds off our app bootstrapping process.

Reply to this email directly or view it on GitHub:
#271 (comment)

@ben-ng

ben-ng commented Aug 7, 2014

Copy link
Copy Markdown
Author

Thank you for the comments @defunctzombie, I've implemented them.

Working on tests next.

@ben-ng

ben-ng commented Aug 7, 2014

Copy link
Copy Markdown
Author

Any suggestions on how to test this? I tried setting Accept-Encoding in engine.io-client's polling transport, but it won't let me because it's an unsafe header.

Even if that worked, I'd need to expose the Content-Encoding of the message somehow in order to assert on it, and that seems like Bad Karma.

@rauchg

rauchg commented Aug 10, 2014

Copy link
Copy Markdown
Contributor

@ben-mg this is better suited for server-side (Node.JS) tests, where you should be able to test it

@rase-

rase- commented Sep 25, 2014

Copy link
Copy Markdown
Contributor

What's your situation with this @ben-ng?

@ben-ng

ben-ng commented Sep 26, 2014

Copy link
Copy Markdown
Author

I couldn't figure out how to write the tests, and don't have the time to do it right now :/ (job, full-time student, etc..)

@rase-

rase- commented Sep 26, 2014

Copy link
Copy Markdown
Contributor

@ben-ng I can look into getting some tests in if you like.

@ben-ng

ben-ng commented Sep 26, 2014

Copy link
Copy Markdown
Author

@rase- that would really help me get started! I do not understand how the test suite works.

@salzhrani

Copy link
Copy Markdown

Any updates ?

@nkzawa nkzawa mentioned this pull request Dec 23, 2014
@defunctzombie

Copy link
Copy Markdown
Contributor

I believe #299 supersedes this PR. Let me know if that is not the case.

darrachequesne pushed a commit that referenced this pull request May 8, 2020
Not base64 encoding for no reason when using websockets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants