Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open to a PR allowing for uglifying print? #280

Closed
mattkrick opened this issue Jan 28, 2016 · 2 comments
Closed

Open to a PR allowing for uglifying print? #280

mattkrick opened this issue Jan 28, 2016 · 2 comments

Comments

@mattkrick
Copy link
Contributor

To reduce request payload size (by around 30%), it's possible to do something like query.replace(/\s/g, '') before serializing the queryString for transmission. The catch is that you have to separate fields by a comma. Unfortunately, if the string is created via print, it won't include commas. Would you be open to a PR allowing for an option to print a string "ugly", meaning replacing newlines & spaces with commas?

@mattkrick
Copy link
Contributor Author

and/or it'd be worthwhile exploring how us common non-facebook folk could implement what was described in #158 (comment)

@leebyron
Copy link
Contributor

leebyron commented Feb 2, 2016

This is a good idea. In the future we should have print and prettyPrint instead of introducing uglyPrint, but in the near term I think it's worth investigating this.

My only feedback is to definitely use compressed requests (usually supported by default in whatever network environment you're using). You should then compare the gzip size of your output from "ugly print" rather than the raw request size. Since multiple spaces tend to compress really well, and because the rest of your document is probably ASCII with english words, you're likely to see very impressive compression, and "ugly" queries are likely to be insignificant - either way I'm super curious to see data on that assumption.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants