{"action":"created","issue":{"url":"https://api.github.com/repos/shazow/urllib3/issues/713","labels_url":"https://api.github.com/repos/shazow/urllib3/issues/713/labels{/name}","comments_url":"https://api.github.com/repos/shazow/urllib3/issues/713/comments","events_url":"https://api.github.com/repos/shazow/urllib3/issues/713/events","html_url":"https://github.com/shazow/urllib3/pull/713","id":109685308,"number":713,"title":"Add optional support for Brotli content-encoding","user":{"login":"Lukasa","id":1382556,"avatar_url":"https://avatars.githubusercontent.com/u/1382556?v=3","gravatar_id":"","url":"https://api.github.com/users/Lukasa","html_url":"https://github.com/Lukasa","followers_url":"https://api.github.com/users/Lukasa/followers","following_url":"https://api.github.com/users/Lukasa/following{/other_user}","gists_url":"https://api.github.com/users/Lukasa/gists{/gist_id}","starred_url":"https://api.github.com/users/Lukasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lukasa/subscriptions","organizations_url":"https://api.github.com/users/Lukasa/orgs","repos_url":"https://api.github.com/users/Lukasa/repos","events_url":"https://api.github.com/users/Lukasa/events{/privacy}","received_events_url":"https://api.github.com/users/Lukasa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-04T15:08:31Z","updated_at":"2015-10-05T11:23:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/shazow/urllib3/pulls/713","html_url":"https://github.com/shazow/urllib3/pull/713","diff_url":"https://github.com/shazow/urllib3/pull/713.diff","patch_url":"https://github.com/shazow/urllib3/pull/713.patch"},"body":"This pull request adds optional support for the [Brotli](http://google-opensource.blogspot.co.uk/2015/09/introducing-brotli-new-compression.html) compression algorithm used as a content-encoding, alongside the current support for gzip and deflate. Chromium have announced their [intention to implement](https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/xdVm8c2GOMQ) Brotli, and Firefox 44 included [their support for Brotli](https://bugzilla.mozilla.org/show_bug.cgi?id=366559). Curl also [intend to implement Brotli](http://curl.haxx.se/docs/todo.html#More_compressions), but it'd be nice to beat @bagder to the punch for once!\r\n\r\nGoogle claims that Brotli achieves 20%-26% higher compression ratios than other compression algorithms. They claim the reference implementation decodes just as quickly as deflate in zlib, but with denser compression than LZMA and bzip2.\r\n\r\nThis implementation currently relies on the hyper project's [brotlipy](https://github.com/python-hyper/brotlipy) sub-project, a CFFI-based wrapper around the Brotli reference implementation. For obvious reasons, as this adds a third-party dependency, the proposed enhancement is a `contrib` module.\r\n\r\nRight now this contrib module monkeypatches its way into urllib3, but in the act of writing it I couldn't help but notice that we're really not very far from being able to have a 'formal' content-encoding plugin system. If that sounds like something worth having let me know, and I could write it and then refactor this contrib module to be the first user of that system. (On the other hand, it may simply not be worth it!)\r\n\r\nIn the short term, **I don't think we should merge this** just because I'm having trouble actually finding a site that uses Brotli! I think the best way to handle this is for me to offer an enhancement to httpbin that uses brotlipy to provide a `/brotli` endpoint, but that means I need to sit down and actually write that. That's blocked behind python-hyper/brotlipy#2, but I can hopefully get around to that soonish."},"comment":{"url":"https://api.github.com/repos/shazow/urllib3/issues/comments/145499970","html_url":"https://github.com/shazow/urllib3/pull/713#issuecomment-145499970","issue_url":"https://api.github.com/repos/shazow/urllib3/issues/713","id":145499970,"user":{"login":"Lukasa","id":1382556,"avatar_url":"https://avatars.githubusercontent.com/u/1382556?v=3","gravatar_id":"","url":"https://api.github.com/users/Lukasa","html_url":"https://github.com/Lukasa","followers_url":"https://api.github.com/users/Lukasa/followers","following_url":"https://api.github.com/users/Lukasa/following{/other_user}","gists_url":"https://api.github.com/users/Lukasa/gists{/gist_id}","starred_url":"https://api.github.com/users/Lukasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lukasa/subscriptions","organizations_url":"https://api.github.com/users/Lukasa/orgs","repos_url":"https://api.github.com/users/Lukasa/repos","events_url":"https://api.github.com/users/Lukasa/events{/privacy}","received_events_url":"https://api.github.com/users/Lukasa/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T11:23:51Z","updated_at":"2015-10-05T11:23:51Z","body":"I've opened a PR against httpbin for their Brotli endpoint given that it seems like it'd be useful, but I'm not enormously confident that it'll get merged. See Runscope/httpbin#254."}}